billyb2 / game

GNU Affero General Public License v3.0
2 stars 0 forks source link

WASM has low performance #18

Closed billyb2 closed 3 years ago

billyb2 commented 3 years ago

While the web assembly port is beautiful and gorgeous and can do no wrong, it has a relatively slow frame rate (30 fps) on my laptop running Arch and Firefox. I'm planning on testing performance on Chrome later, but either way this should be looked into. Individual compiler optimizations would probably do the most, but increasing the game's single threaded efficiency would also really help.

billyb2 commented 3 years ago

So after testing on Brave Browser (Chromium based), it runs much much faster than on Firefox, coming in at a solid 60 fps with optimizations (which are now enabled by default). While I now think that this is a non-issue, looking into why it's so slow on Firefox is important, since I use it lol.

billyb2 commented 3 years ago

97bbc1683f11f0102949658cf844913bc24bd276 helped a ton with the performance thing, since the game now looks like its running more smoothly

billyb2 commented 3 years ago

Just wanted to say somewhere that the game currently uses 3.24 MB of memory, when using the maximum optimization possible.

billyb2 commented 3 years ago

I think that the performance in WASM is good enough for now, using opt-level = 2 and the bulk memory stuff makes it so the game runs very smoothly.