Open Bug 1626816 Opened 5 years ago Updated 3 years ago

WebRender program cache / shader initialization blocks the main thread via the sync IPC message PWebRenderBridge::EnsureConnected (25ms-40ms startup penalty)

Categories

(Core :: Graphics: WebRender, defect, P3)

defect

Tracking

()

Performance Impact medium

People

(Reporter: mstange, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf:responsiveness)

Profile: https://perfht.ml/39BkB5A

During startup, the main thread blocks until WebRender is initialized, via the following call path:
nsWindow::Create -> nsWindow::CreateLayerManager -> nsBaseWidget::CreateCompositor -> nsBaseWidget::CreateCompositorSession -> WebRenderLayerManager::Initialize -> bridge->SendEnsureConnected()

The time spent blocking in this function should be minimized. The main thread has more things to do before it can start the initial page load.

However, the reply to this message seems to be delayed by shader initialization: The WR program cache reads cached shaders from disk and passes them on to GL. I don't know whether this work is happening as a result of the EnsureConnected() call, or whether it started early and just happens to still run at the time the EnsureConnected() call comes in. In any case, it would be good to do this work asynchronously so that EnsureConnected can finish as quickly as possible and the main thread can move on.

Priority: -- → P3

(might be even p1)

Whiteboard: [qf] → [qf:p2:responsiveness]

Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is P3 (Backlog,) indicating it has been triaged, the bug's Severity is being updated to S3 (normal.)

Severity: normal → S3
Performance Impact: --- → P2
Whiteboard: [qf:p2:responsiveness]
You need to log in before you can comment on or make changes to this bug.