GithubHelp home page GithubHelp logo

addComponent with initial value about bitecs HOT 2 CLOSED

zewa666 avatar zewa666 commented on June 10, 2024
addComponent with initial value

from bitecs.

Comments (2)

zewa666 avatar zewa666 commented on June 10, 2024 1

thanks for the detailed explanation and pretty much what I anticipated.

from bitecs.

NateTheGreatt avatar NateTheGreatt commented on June 10, 2024

i try to make bitECS as performant as possible, and let the users degrade the performance where appropriate for their particular use-case. one of the keys to this is creating as little garbage as possible so that the GC has nothing to clean up, and that is accomplished by pre-allocating everything up-front. technically this new function of yours, while syntactically cleaner, creates an object every time you add a component. the original addComponent creates no objects and therefor has no chance creating any garbage to clean up.

my goal with bitECS is to do less for the user and remain as flexible and performant as possible for all potential use-cases. this function does more for the user, and creates objects, so i won't be adding anything like this into the API.

not to say i discourage functions like this, just want to keep GC-generating things outside of the API. all depends on your use-case :)

from bitecs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.