DrawSurfaceWithShadow in canvas is very slow
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox109 | --- | verified |
People
(Reporter: canova, Assigned: jfkthame)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files)
I was looking at a website I found and the performance of it was very poor. It was drawing one frame every 7 seconds. On the other hand Chrome is silky smooth.
Here's the website: https://ubähnchen.vercel.app/en
Here's a Firefox Profiler profile: https://share.firefox.dev/3CVEIh1
If you look at the profile, the content process shows that the nearly all the time is spent inside mozilla::gfx::DrawTargetWebgl::DrawSurfaceWithShadow
.
It's probably because we do this on software and Chrome uses hardware acceleration. Would doing the same for us also fix this issue?
Updated•2 years ago
|
Updated•2 years ago
|
Comment 1•2 years ago
|
||
The Performance Impact Calculator has determined this bug's performance impact to be high. If you'd like to request re-triage, you can reset the Performance Impact flag to "?" or needinfo the triage sheriff.
Platforms: [x] Windows [x] macOS [x] Linux
Impact on browser: Causes noticeable jank
Impact on site: Causes noticeable jank
Page load impact: Some
[x] Affects animation smoothness
[x] Able to reproduce locally
Comment 2•2 years ago
|
||
This is worse with gpu-canvas: https://share.firefox.dev/3gSoAV0
Updated•2 years ago
|
Comment 3•2 years ago
|
||
The severity field for this bug is set to S3. However, the Performance Impact
field flags this bug as having a high impact on the performance.
:bhood, could you consider increasing the severity of this performance-impacting bug? Alternatively, if you think the performance impact is lower than previously assessed, could you request a re-triage from the performance team by setting the Performance Impact
flag to ?
?
For more information, please visit auto_nag documentation.
Comment 4•2 years ago
|
||
I get the same result as the OP using current release, so this is definitely a performance problem. Lee, anything we can do here?
Assignee | ||
Comment 5•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 6•2 years ago
|
||
This patch makes the performance vastly better for me (tested on macOS, but presumably helps similarly on others). Still doesn't look as smooth as Chrome, I think, but at least it's quite usable.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 8•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Comment 9•2 years ago
|
||
Comment 10•2 years ago
•
|
||
Hello Nazım Can Altınova, we tried to verify this fix on our side and noticed that in Firefox 109.0b4 and Nightly 110.0a1 the website https://ubähnchen.vercel.app/en runs pretty smoothly, but still not as smoothly as it does in Chrome. I will attach a screen recording of how it is working on our side.
Could you please let us know how is the website working on your side using the latest versions Firefox 109.0b4 and Nightly 110.0a1?
Assignee | ||
Comment 11•2 years ago
|
||
(In reply to Ina Popescu from comment #10)
Hello Nazım Can Altınova, we tried to verify this fix on our side and noticed that in Firefox 109.0b4 and Nightly 110.0a1 the website https://ubähnchen.vercel.app/en runs pretty smoothly, but still not as smoothly as it does in Chrome. I will attach a screen recording of how it is working on our side.
This is greatly improved from the performance in 108, right? If so, I think we can say the patch here is working as expected. For the remaining difference from Chrome, it might be worth filing a new bug (and capturing a new performance profile) as a followup.
Reporter | ||
Comment 12•2 years ago
|
||
It runs very smoothly on my machine now but my machine is pretty powerful (M1 max macbook). From the video it looks like the performance is greatly improved indeed. Previously I was getting a single frame every 7 seconds or so (with the same machine), so this is definitely a huge upgrade. I would say this patch is working as expected. I can file another bug with a new profile later.
Thanks for improving the performance!
Assignee | ||
Comment 13•2 years ago
|
||
Ina Popescu: it looks like your testing in comment 9 video is on a less powerful machine (it's noticeably less smooth than what I get on mine), so it might be useful to get a profile from that system to see what the remaining bottlenecks may be. (But in a new bug, please, to avoid confusion.)
Comment 14•2 years ago
|
||
It looks reasonable on my machine but not supersmooth. This is a very powerful machine and a profile shows us we're spending most of our time creating and destroying the temporary surfaces: https://share.firefox.dev/3HNryoN
I wonder if there's room here for re-using surfaces.
Comment 15•2 years ago
|
||
(In reply to Jonathan Kew [:jfkthame] from comment #13)
Ina Popescu: it looks like your testing in comment 9 video is on a less powerful machine (it's noticeably less smooth than what I get on mine), so it might be useful to get a profile from that system to see what the remaining bottlenecks may be. (But in a new bug, please, to avoid confusion.)
Indeed the performance of the website was insignificantly improved on both Firefox 109.0b4 and Nightly 110.0a1. The website is not performing as smoothly as Chrome on Windows 10. For this I've filed Bug 1806597 as follow up.
Description
•