-
Notifications
You must be signed in to change notification settings - Fork 5
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
Comparison with other ECS frameworks #1
Comments
I just had a look on it. Looks like it is only benchmarking one thing: iterate all entities and perform some task on their components. On my macbook running the ecx framework I got around 60000 op/s. ash = 4000 op/s My current ecs implementation has around 8000 op/s, which is expected Though after some optimization I got 130000 op/s. Maybe we should benchmark other aspect as well. |
So it's >2x faster than ECX? (i.e is 130k not a typo instead of 13k) |
Yes, 2x as fast |
Did your optimisations make it in? Looks like you are still iterating on maps in places. I would typically create a separate array of iteration (potentially making a new class implementing a map interface). I think the HashTable in polygonal.ds lazy inits an array to use for the iterator. |
It is iterating an array now: https://github.com/kevinresol/ecs/blob/9ad36a0/src/ecs/node/NodeList.hx#L72 But I need to re-emphasize that the optimizing on a single part of the codebase doesn't mean much. |
Oh... you removed the map? To be clear I didn't mean to suggest to replace maps with arrays, but rather to use both. Use array (or perhaps list) for iteration and map for addressing by component type. The overhead of maintaining two structures is negligible compared to the cost of using one or the other for purposes to which they are not suited. Polygonal's HashTable does this and also allows for reuse of the iterator which could further help (where code is synchronous). (https://github.com/polygonal/ds/blob/master/src/polygonal/ds/HashTable.hx) |
Hi, did you run any benchmarks against ECX or Edge (specifically this branch)?
The text was updated successfully, but these errors were encountered: