scratchfoundation / scratch-vm

Virtual Machine used to represent, run, and maintain the state of programs for Scratch 3.0
http://scratchfoundation.github.io/scratch-vm/
BSD 3-Clause "New" or "Revised" License
1.2k stars 1.49k forks source link

Firefox running "game loop" at 22 FPS #3715

Open ggenije opened 2 years ago

ggenije commented 2 years ago

Expected Behavior

The FPS should be ~30 like in google chrome

Actual Behavior

The FPS is ~22 even without performance demands.

Steps to Reproduce

Use firefox. firefox 22 fps.zip rename .zip to .sb3

I don't have any extensions , I tested it on freshly installed firefox on multiple devices (laptop and two PCs).

System Details

My browser / operating system: Windows NT 10.0, Firefox 103.0, No Flash version detected

Screenshots

firefoxslow

cwillisf commented 2 years ago

Strange... I tried this out on my development computer and:

So this seems to be a genuine problem related to Firefox, but it's unclear whether it's a Scratch bug, a Firefox bug, or Scratch running into a difference in how Firefox handles something about timing. We'll need to investigate.

I also tried Geometry Dash, a Scratch game with a built-in FPS counter. In Chrome, I was getting about 16 FPS but it felt OK to play. In Firefox, the FPS counter said 22 but it felt slower to me. Not sure what's up with that, either!

If anyone figures out more information about this, please share. Thanks!

adroitwhiz commented 2 years ago

It might have something to do with timer resolution? I remember there being some animation issues relating to rounding off timer precision to 100ms.

redspacecat commented 1 month ago

I've noticed this also. I've been testing with various projects, and getting 21-22 fps on all of them. This makes games like Geometry Dash annoying to play.