Benchmarks
ECS operations
TODO: Tabular overview of the runtime cost of typical ECS operations. See Arche’s benchmarks for an example.
Versus Array of Structs
The plots below show the iteration time per entity in the classical Position-Velocity example.
That is, iterate all entities with components Position
and Velocity
, and add velocity to position:
position.x += velocity.x
position.y += velocity.y
The benchmark is performed with different amounts of “payload components”,
where each of them has two Float64
fields, just like Position
and Velocity
.
Further, the total number of entities is varied from 100 to 1 million.
Note that the benchmarks run in the Github CI, which uses very powerful hardware. Particularly, the processors have 256MB of cache. On a laptop or desktop computer with typically much less cache, Larecs🌲 will outperform AoS for everything but the smallest setups.