Avoid compiling default composite shader if not required
Categories
(Core :: Graphics: WebRender, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox149 | --- | fixed |
People
(Reporter: jnicol, Assigned: jnicol)
References
Details
(Keywords: perf-alert)
Attachments
(1 file)
In draw_tile_list() we always start by binding the default composite shader (i.e. non-fast-path, ImageBufferKind::Texture2D). Then we iterate through the tiles, and when we need a different shader variant (e.g. fast path, or different ImageBufferKind), we flush the batch and bind the next shader.
This is usually fine, but binding a shader can be expensive on some devices, eg because loading cached program binaries is expensive (bug 1954587). Or the shader cache doesn't work at all, or it's the first run.
Often only the fast path composite shader will be required for a page, and compiling the non-fast path variant is therefore a waste of time. For example our android applink-startup tests. We should restructure this function to bind the shader immediately before submitting the draw call, when we know which variant we require.
| Assignee | ||
Comment 1•7 months ago
|
||
The webrender draw compositor's draw_tile_list() function was eagerly
binding the default composite shader prior to iterating through its
tile list. In practice, many pages only require the fast path
composite shader. Typically this is not a major issue, but on certain
devices loading program binaries may be slow (bug 1954587), or the
shader cache may be disabled or just empty on the first run. In which
case compiling a shader that is not yet required is a significant
waste of time and slows down first paint.
Instead of binding the default composite shader at the start, then
binding each new shader after submitting a batch, this patch makes
it so that we bind the required shader just before submitting each
batch, meaning we only bind the shaders we actually use.
Updated•7 months ago
|
Comment 3•7 months ago
|
||
| bugherder | ||
Comment 4•7 months ago
|
||
(In reply to Norisz Fay [:noriszfay] from comment #3)
Perfherder has detected a mozperftest performance change from push ace7a636195caa9e23462f1a26714b1fd8f879f7.
No action is required from the author; this comment is provided for informational purposes only.
| Improvement | Test | Platform | Options | Absolute values [old vs new] |
|---|---|---|---|---|
| 6% | tab-restore-shopify org.mozilla.fenix:gpu-cpu-time | android-hw-a55-14-0-aarch64-shippable | 803.33 ms -> 757.33 ms |
Need Help or Information?
If you have any questions, please reach out to fbilt@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.
Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.
Updated•6 months ago
|
Description
•