TIC-80
TIC-80 copied to clipboard
Games in Firefox slow down. (if you do not move the mouse intensively)
OS: Windows 10 Firefox: 85.0.2 (x64)
example: https://tic80.com/play?cart=115
Don't move the mouse cursor: https://user-images.githubusercontent.com/12137233/107885422-523d3b00-6f0b-11eb-9389-1437cf513df6.mp4 Move the mouse cursor, then stop: https://user-images.githubusercontent.com/12137233/107885485-a9431000-6f0b-11eb-9bcf-c372b3595437.mp4
It's running okay for me. An older version of Firefox, and an older laptop. It sounds like a limitation on the CPU? What hardware are you on? Try Chrome instead, I've seen differences in the ways they run WASM.
If it was a CPU limitation, then there would be problems in other browsers, right? But in other browsers everything is fine (the problem appears specifically in firefox). And if you move the mouse, then there is no slowdown. CPU: I7-4770k
Firefox's implementation of web assembly is somewhat different than Chrome's implementation. There isn't much that we can do in TIC-80 to help that.
CPU: I7-4770k
@RobLoach That's no slouch of a CPU. It's quite possible it's indeed a Firefox issue, but I'm not sure it's a CPU issue - since as stated it works normally if the mouse is moved... Sadly I have no idea what to suggest though.
after run cart firefox: total cpu usage ~7% total gpu usage ~ 20% opera: total cpu usage ~7% total gpu usage ~ 10%
firefox: when launched in multiple tabs, slows down in all tabs (no worse than it was) opera: when launched in multiple tabs, works well
Update: Achieved even more dramatic slowdown in the browser:
- Open firefox
- Open https://tic80.com/play?cart=115
- Open https://tic80.com/play?cart=115 in the second tab. Result: (sound from the first tab is muted) https://user-images.githubusercontent.com/12137233/107926929-6161ce80-6f87-11eb-9fe8-c8308a743107.mp4 Mouse movements also give some positive effect, but overall even worse than in the first tab.
- Then I closed the first tab. Nothing changed.
This sounds like perhaps a Firefox problem more than a TIC-80 problem... can we reproduce this now in 2022 with the latest builds of TIC-80 and Firefox?
I confirm. The problem is reproduced with the latest builds of TIC-80 and Firefox.
I'm also seeing slowdown issues in my own game (link) when viewing it in Firefox. I'm using Firefox 113.0.2 (Windows 11).
I am using pairs(...) and closures in a few places. But, I experimentally got rid of those and the game still crawls :(
I did find something interesting though. I intended to open Firefox's Inspector and do some profiling, but, weirdly enough, my game runs perfectly when Firefox is recording a profile. ???
Then when I stop recording a profile, the game slows to a crawl again. I really have no idea what's going on.
I won the game! Played on Firefox 113.0.2 (64-bit) Linux, didn't experience any slowdown. Fun game! Brought me back to playing Lemmings as a kid.