This folder contains benchmarks for zentt as well as the following ECS libraries:
The goal is to compare the performance in similar scenarios, although because of API and implementation differences each ECS has some unique benchmarks aswell.
Each benchmark was run 10 times, creating/modifying/iterating 1'000'000 entities, the world/registry containing the entities was only cleared between each run (no new world/registry), so subsequent runs were faster because memory for components and entities was already allocated in the world.
Numbers in each cell: average, fastest, slowest, all units are in nano second unless specified explicitly.
Benchmark | zentt | Bevy | EnTT | |
---|---|---|---|---|
Create empty entity | Avg Min Max |
11 8 26 |
30 25 58 |
3.85 3.58 4.23 |
Create entity, add component (8 bytes) |
Avg Min Max |
52 48 68 |
111 101 141 |
22 20 36 |
Create entity, add 5 components (72 bytes) |
Avg Min Max |
371 332 458 |
548 521 608 |
136 105 155 |
Create entity bundle with 5 components (72 bytes) |
Avg Min Max |
101 87 158 |
206 165 244 |
- |
Create entity, add 8 components (192 bytes) |
Avg Min Max |
722 687 847 |
1067 1037 1196 |
224 189 318 |
Create entity bundle with 8 components (192 bytes) |
Avg Min Max |
172 134 318 |
280 264 401 |
- |
Create entity, add five empty components | Avg Min Max |
|||
Create entity bundle with five empty components |
Avg Min Max |
|||
Add component (40 bytes) to entity with 5 components (72 bytes) |
Avg Min Max |
140 119 226 |
252 241 326 |
23 20 45 |
Add one component (192 bytes) to entity | Avg Min Max |
|||
Iterate entities with one component | Avg Min Max |
2.18 1.84 2.87 |
2.31 1.92 3.76 |
1.79 1.54 2.79 |
Iterate entities with eight components, use three |
Avg Min Max |
8.22 7.04 9.76 |
11.50 9.56 13.14 |
10.94 10.11 11.91 |
Iterate entities with eight components, use all |
Avg Min Max |
8.37 7.14 9.84 |
12.58 10.25 15.84 |
22.21 18.92 32.57 |
Iterate entities with five components, different combinations, use 2 |
Avg Min Max |
2.54 1.97 3.13 |
2.23 1.87 3.85 |
View, Group 3.28, 1.96 2.92, 1.41 3.76, 2.97 |
Iterate entities with five components, more different combinations, use 2 A & B |
Avg Min Max |
2.21 2.91 4.08 |
3.66 3.04 4.83 |
4.02 3.28 4.92 |
Iterate entities with five components, more different combinations, use 2 A & C |
Avg Min Max |
4.56 3.84 6.16 |
4.42 3.91 6.06 |
8.85 7.90 10.48 |
Record create entity commands | Avg Min Max |
22 15 86 |
- | - |
Apply create entity commands | Avg Min Max |
12 10 18 |
- | - |
Record create entity commands and add 8 components (192 bytes) |
Avg Min Max |
299 201 1018 |
- | - |
Apply create entity commands and add 8 components (192 bytes) |
Avg Min Max |
784 722 909 |
- | - |
Record create entity bundle commands with 8 components (192 bytes) |
Avg Min Max |
100 79 234 |
- | - |
Apply create entity bundle commands withand add 8 components (192 bytes) |
Avg Min Max |
263 231 383 |
- | - |
Avg Min Max |
This contains the raw output from the benchmark programs.