Show HN: Simulating 20M Particles in JavaScript (opens in a new tab)dgerrells.com
561 pointsHad some fun with shared array buffers over many months of free time.
Skip to the end to play around with the final app.
Open to ideas on how to simulate more whilst staying in js land.

Comments (70) 25 threads
Show all comments
Showing thread 10 of 25
Too bad we cant just rely on JS only and have to involve a bunch of DOM operations, which is usually the slow part of the UIs we create.
No? With WebGL and soon WebGPU, or in this case here with writing to a imagebuffer and just passing that to canvas, you don't have to use the DOM anymore since quite a while.
(but then you don't get all the nice things html offers, like displaying and styling text etc)
In reality, you're right, there are alternatives, but for the basic web documents, it kind of hurts more than help to use them.
However, that's not where the problem starts. A lot of web sites are slow because they simply run too much code that doesn't need running in the first place and allocates objects that don't need to be allocated.
We don't need lower level constructs if we can simply start by removing cruft and be more wary of adding it. Go back to KISS/YAGNI.