Open Bug 1833620 Opened 2 years ago Updated 1 year ago

sinerider.com is slow

Categories

(Core :: Graphics: Canvas2D, defect)

x86_64
Linux
defect

Tracking

()

Performance Impact low

People

(Reporter: jason.orendorff, Unassigned)

Details

(Keywords: perf:animation, perf:responsiveness)

https://sinerider.com/ is an open source game. See https://github.com/hackclub/sinerider. Sadly it's too slow to play in Firefox. Works OK in Chrome.

They're using Canvas drawImage with scaling. There are very old open bugs about that (bug 753924, bug 724482, etc.); filing a new one just in case that's not the whole story here.

This profile is on a Linux ThinkPad; alas, drawImage runs entirely on the CPU for me. The game is just as slow on my x86_64 Macbook, though.

https://share.firefox.dev/3Ijybil

Lots of drawImage with scaling and transparency. Both my laptops have high pixel density screens; the ThinkPad is 3840x2160 and the jank is worst when Firefox is maximized. If I shrink the window to about 1/6 of the screen, we can keep up.

Easier to address by changing the game, obviously...

Profile on Windows :
gpu-canvas: https://share.firefox.dev/3MwJczd
D2d-Canvas: https://share.firefox.dev/42K6Eyv

Looks to be filled with filters. D2d-canvas is faster than GPU-canvas.

Component: DOM: Core & HTML → Graphics: Canvas2D
Status: UNCONFIRMED → NEW
Ever confirmed: true

BTW the game is easy to run locally -- clone and python3 -m http.server 3000.

They have an open issue for being slow in Firefox: https://github.com/hackclub/sinerider/issues/547.

Our accelerated canvas implementation does not support filters, so we hit the software Skia fallback path to render the filters, which is slow.

We have long term plans to improve filter performance but are unlikely to get to this in the short term.

Severity: -- → S4
Performance Impact: --- → ?

The Performance Impact Calculator has determined this bug's performance impact to be low. If you'd like to request re-triage, you can reset the Performance Impact flag to "?" or needinfo the triage sheriff.

Impact on site: Causes noticeable jank
Websites affected: Rare
[x] Affects animation smoothness

Performance Impact: ? → low
You need to log in before you can comment on or make changes to this bug.