noctjs / ecs-benchmark

ECS benchmark comparison
MIT License
111 stars 23 forks source link

Specify component values #12

Closed ooflorent closed 3 years ago

ooflorent commented 3 years ago

Component values

In order to be closer to real-world use cases and performance expectations, I decided to specify the values of the components. ECSY suffers the most from this change (-33%).

More realistic data types

Another notable change is the usage of floats for position and velocity components. In v8, Smi (Small and Medium Integers) are stored within registers whereas decimal numbers are stored inside the stack. This change has serious performance implications. However, most games would use decimal numbers to represent the transform components of their entities.

Renaming of Animation#length into Animation#size

It is not possible to name a component property length in bitecs. I decided to rename the property to size to be consistent across all libraries.