Comment by Sharlin
16 hours ago
Plays at ~3fps and with a ~1s latency on all interactions on Firefox, MBP2015 :( Slightly better on Chrome, but the menu is still incredibly laggy and the placement grid lags way behind the mouse cursor. Got to say that the performance isn't exactly that of Rollercoaster Tycoon, famously written by Chris Sawyer in lovingly hand-crafted assembly!
It definitaly runs slow on Firefox on my M1 Max (<10 fps). It runs butter smooth in Chrome for me on the same machine.
Firefox has some incredibly slow paths in its graphics stack. If you happen to use those you're S.O.L.
it runs quite fast on a first generation mac studio with safari
yeah I wonder if a rust or wasm backend might be a good idea for something like this
Nah, I think the implementation is just off. Graphics need HW acceleration for modern resolutions, but the whole thing should be fine in vanilla JS. Afaik wasm is just an abstraction on top of a jsvm
> Afaik wasm is just an abstraction on top of a jsvm
it is, but as a compiler target there's tons of opportunity for automatic optimization -- in my experience wasm (from rust) tends to be faster then then hand-written js for the same function (although, i'll admit, javascript is far from my strongest language, so take that with a grain of salt)
Wasm objects are what you get in C or other low-level language, with a linear heap and zero metadata. That alone makes it vastly faster and easier to JIT than JavaScript.