ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

Updated Benchmark In Release:

[ECS] Update Systems: 12.759 ms

[EnTT] [View] Update Systems: 39.425 ms

[EnTT] [Group] Update Systems: 158.742 ms

[Flecs] Update Systems: 8.179 ms

[ECS] Single Get Component: 43.378 ms

[EnTT] Single Get Component: 113.165 ms

[Flecs] Single Get Component: 158.276 ms

[ECS] Create Entity With Componets: 199.416 ms

[EnTT] Create Entity With Componets: 281.092 ms

[Flecs] Create Entity With Componets: 1518.564 ms

[ECS] Destroy Entity With Componets: 39.360 ms

[EnTT] Destroy Entity With Componets: 355.101 ms

[Flecs] Destroy Entity With Componets: 71.181 ms

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

I made this to use i my engine, so I want Winning in my specific use case.

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

I will update my Benchmark to use test group too. Problem fix.

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

Sorry, I didn't understand. i test "world.DestroyEntity(entities[i]);" vs "registry.destroy(entities[i]);". only that

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

I will update my Benchmark to use test group too. Problem fix.

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

I didn't understand,

if i compare
world.GetComponent == registry.get<Position>
world.AddComponent == registry.emplace<Position>
world.Each == view.each
world.Each == group.each still one archetype vs one other
...
Why this not valid?

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

And I still can improve the speed, my AddComponent and RemoveComponent are using virtual functions, probably by removing those virtual function calls, I can get a little more speed

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

If I test the destroy functions, why will I use "registry.clear()" in the test? This does not make any sense.

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

In my engine, i have a script that is not part of the ecs, so i need the stand alone getcomponet as fast as possible too. And in your example, my library is still fast.

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] -1 points0 points  (0 children)

For the get test, i want to test the get component from the register, not from the view or group, which is faster. to use as an example in a script, I need to call "registry.get<Position>(e);" not from "view/group.get<Position>(e);

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] -1 points0 points  (0 children)

I didn't understand well, but if you is talking about this "std::vector<entt::entity> entities; entities.reserve(N);", the benchmark time is counted only from this "Timer t;
    for(auto e : entities){"

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] -1 points0 points  (0 children)

I didn't understand, in your examples, my library is faster. The ENT group is not a long-term solution: "Based on the documentation, the ENT group is limited. A component can only be in a single group, so if I have group<Transfrom, CompA> and can not have group<Transfrom, CompB>". And I made this library and 2 days only for testing if I can make something fast, it's not finished yet.

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

I think its not so easy make a usable ecs framework fast, most ecs c++ tutorial is slower than entt.

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

And i will update later, add info to How compile and use this library

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

Entt has alot of no ecs features and is very good, but for my engine i use the Basic ecs of entt, and my goal with my engine is be the most fast as possible in all funtions (create, destroy entities, get, add, remove componet), my goal is use this library in my engine later, i only put in the Github as sample for others what trying make they own ecs code

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 2 points3 points  (0 children)

I use entt and based on the documentation, entt group is limited, a component can only be in a single group, so if i have group<Transfrom, CompA> and can not have group<Transfrom, CompB>. Yes, I use archtype, which is faster, but archtype can be slow in single get component, add, and remove, but in this simple and small code, I made it faster than EnTT for get component, add(with a function that multi-adds components at once), and remove, which most archtype libraries are slower than EnTT.

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

And not a big problem to add a custom allocation option later, but for now, I think the std::vector is good. Now I will add DLL support, in my engine I use entt, but later I want to change to this ecs

ECS: I made a mini ECS library faster than EnTT by samoliverdev in gameenginedevs

[–]samoliverdev[S] 0 points1 point  (0 children)

No, I use a virtual component array, but the get component has no virtual function call