The Physics of Memory (aka can Javascript ECS?)
19 points by dmurph
19 points by dmurph
Nice article.
I suggest splitting it up for clarity. Like the SoA and their performance. Then another on the each data structure (tree) etc.
Thanks! Yeah I got a bit carried away and struggled to reign all the variables into a not-super-long article. I almost did a whole new dimension on the spacial hash index, which has its own benefits and drawbacks.
I loved the sorting dive too - seeing the perf impact on a hybrid merge vs the full recursive impl.
If I have the time it might be nice to do deeper dives into each methodology - I have the source code linked from each 'result' tile but it's not super discoverable.
Just wanna say it's great that you took the time to benchmark different cases and dig for performance, I appreciate it =)
I'm using SoA (not a full ECS) in JS to great results in an internal project at work. The speedup is impressive for some workflows, but a less obvious benefit is that it blunts the impact of memory leaks. Memory leaks via closures are unfortunately somewhat common and can be difficult to debug in JS. Because you're passing around numbers instead of object references, what was previously a tree of interconnected objects leaking becomes a single number.