Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FPSMeter is causing main thread activity #70

Open
bramus opened this issue Jan 25, 2024 · 1 comment
Open

FPSMeter is causing main thread activity #70

bramus opened this issue Jan 25, 2024 · 1 comment

Comments

@bramus
Copy link

bramus commented Jan 25, 2024

The FPS Meter widget is updated via rAF. While not a problem in itself, this is causing issues for WAAPI/CSS animations in some browsers (see #69 for these tests).

In Blink (Chromium), the presence of a rAF will cause the animations – which already happened on the compositor – to also happen on the main thread because you could query for style values inside the rAF. Because of this, WAAPI/CSS animations perform worse when the FPS Meter is present.

See https://bramus.github.io/canvas-engines-comparison/dom-waapi.html for an implementation that allows disabling the FPS Meter widget.

@bramus
Copy link
Author

bramus commented Jan 25, 2024

For comparison, here’s a performance profile measured in Safari to show the difference.

With FPS Meter Without FPS Meter
Screenshot 2024-01-25 at 16 24 03 Screenshot 2024-01-25 at 16 23 48

(Note that the 9fps in the one screenshot isn’t representative. It’s the ongoing profiling that is slowing things down. When not profiling, the reported number is around 49fps on my machine)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant