-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated Code Optimization #780
Comments
Hi, thanks for the suggestion. I will try to find time to create a performance test, to see see the benefits |
Interesting, I remember a long time ago, when I added component pooling, I was explicitly testing and the latter was faster. Tested again now and it's the other way around. I will update the generated code! |
Passing in the an entity factory method speed things up by a factor of 2x, very nice! |
Hi,
Currently Entitas' ComponentEntityGenerator is using CreateComponent for AddComponent/RemoveComponent.
This means (heavy) use of Generics which carries a small but non-trivial performance penality. I dont have any easy-to-share benchmarks, but it improved starting-performance slightly for our specific case.
Related is use of Activator.CreateInstance for creation of entities. We've replaced this with a function passed as the last argument for Context constructor. The context caches this function and uses it instead of the generic version.
Cheers
The text was updated successfully, but these errors were encountered: