noctjs / ecs-benchmark

ECS benchmark comparison
MIT License
110 stars 23 forks source link

Add piecs #49

Closed sondresj closed 2 years ago

sondresj commented 2 years ago

Since the tests must be .js (as opposed to .mjs) I had to import the mjs bundle from my package (it resolved the cjs bundle by default). There was a significant (up to 2x) performance difference by doing that. Maybe something strange with my .cjs bundle, not sure..

Hopefully that import is ok :)

sondresj commented 2 years ago

Btw, I noticed this:

The best result for each benchmark is marked in bold text.

in the readme, there currently where no results marked in bold text, should I do this?

sondresj commented 2 years ago

Rebased the fork to squash the commits, figured I wanted one last feature in piecs while I still could 😇

One thing to note, in the Add Remove test, I'm using a "prefab" (I might be using the term prefab a little differently than other ecs') to effectively add/remove components (world.transformEntity), this is aprox 1.5 times faster than adding or removing a component explicitly in piecs, but effectively does the same. If this is bending the rules, or even breaking the rules, then I can change to using add/remove component instead.

In all the queries I also utilize prefabs, but there's no functional difference between querying a prefab or querying all of the components constituting the prefab. So I hope this too is within the rules (there's no performance difference, just less code).

I've also noticed that on my computer, results on some test (typically frag_iter and packed_1) may have 2-3 times worse results between runs. I've noticed it on bitecs, wolf-ecs and piecs, but I suspect it happens to others too. Dunno if this is some oddity on my computer, the testing setup or just V8?

Hopefully this looks OK now though, and you accept the submission 😄

Thanks in advance

sondresj commented 2 years ago

Closing this pr as it's outdated now. will open a new one if you want me to @ooflorent

ooflorent commented 2 years ago

Fine! Could you skip the update of the result table? It is likely to end in a merge conflict.