Slow canvases block the compositor thread
Categories
(Core :: Graphics: WebRender, defect, P1)
Tracking
()
People
(Reporter: nical, Assigned: nical)
References
(Blocks 3 open bugs)
Details
I've seen a few other bugs on file which were attributed to the canvas slowness, let's dedicate this one to the synchronization between the canvas renderer and the compositor. We really need to not do that since it causes slow canvases to block all rendering including the UI.
See the test case and profile in bug 1894847.
At some point the compositor blocks until the canvas is done rendering in RemoteTextureMap::WaitForRemoteTexture
.
If the canvas has a very heavy workload, rendering can be blocked for a very long time (seconds). Adding WebGPU into the mix makes it even easier to hit because shader compilationg with FXC (on windows) can block the canvas renderer threads for multiple seconds.
If blocking is a necessity, we could use the low priority scene builder thread to block instead of the compositor thread. That way APZ and updating the UI would still work.
Comment 2•6 months ago
•
|
||
There is a bug for removing the wait of RemoteTextureMap::WaitForRemoteTextureOwner() as Bug 1863257.
WebRenderAPI already has a capability of waiting remote texture, it could be extended as to wait also RemoteTextureOwner.
Assignee | ||
Updated•6 months ago
|
Comment 3•6 months ago
|
||
Did you actually mean to close this bug as FIXED?
Comment 4•6 months ago
|
||
Assuming it was by mistake.
Assignee | ||
Comment 5•5 months ago
|
||
It was fixed by bug 1863257 which unfortunately was backed out since.
Comment 6•5 months ago
|
||
Bug 1898650 re-remove the sync wait on Nightly.
Comment 7•5 months ago
|
||
Assigning to Nical for tracking purposes.
Comment 8•5 months ago
|
||
With the patches of bug 1899231 applied, background canvas demos can still heavily jank a profiler page.
I opened the testcase from bug 1894847 and profiled it. Then i tried navigating inside the profiler page. The UI was very janky.
Profile of the demo running : https://share.firefox.dev/3VgiFsU
Profile of interacting with the profiler UI while the demo runs in the background (Slow/janky) : https://share.firefox.dev/3RthYvv
Assignee | ||
Updated•5 months ago
|
Assignee | ||
Comment 9•5 months ago
|
||
Sotaro landed the fix in another bug. Heavy canvas workloads can still slow things down but don't appear to freeze the whole UI for multiple seconds which is what this bug was about.
Description
•