sw-wr: nasdaq.com spends lots of time in linear gradients
Categories
(Core :: Graphics: WebRender, defect, P3)
Tracking
()
People
(Reporter: jrmuizel, Assigned: lsalzman)
References
(Blocks 1 open bug)
Details
(Keywords: perf-alert)
Crash Data
Attachments
(6 files)
(deleted),
text/html
|
Details | |
(deleted),
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details |
(deleted),
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details |
(deleted),
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details |
(deleted),
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details |
(deleted),
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details |
Reporter | ||
Comment 1•4 years ago
|
||
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
For linear gradients, we are currently bottlenecked by looking up a gradient
table entry, doing interpolation, and converting to pixel formats for every
sample.
We can accelerate this by instead looking for contiguous segments of gradient
within the range of entries we need to sample and then interpolating these
as a single gradient. This also enables us to convert to relevant pixel formats
only when setting up this gradient, which greatly reduces the per-pixel processing
down to essentially a shift and add.
To enable this sort of crawling of the gradient table, the output gradients have
been modified such that each entry's step value will equal an adjacent entry's
step value if and only if they are from same gradient. We can ensure this by, in
the very rare case two segments of gradient have the same step, using the equivalent
of nextafter() to imperceptibly alter the value so that the invariant is maintained.
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
The same optimization of looking for merged linear gradients can also be
applied to radial gradients by solving the quadratic equation to check
how large a span we can process within a given merged span. This allows
us to save a bunch of table lookup and some other math in the inner loops.
Depends on D105716
Assignee | ||
Comment 4•4 years ago
|
||
Some sites use pixelated image-rendering and/or 1x1 images as color sources.
When we hit these, we fall off the fast-path. Try to handle at least some of
the cases we are finding in the wild.
Depends on D105858
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
Comment 8•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6e97ee33645a
https://hg.mozilla.org/mozilla-central/rev/395458ef80ae
https://hg.mozilla.org/mozilla-central/rev/01f66dc6aca4
https://hg.mozilla.org/mozilla-central/rev/8f0413b1ad6f
Comment 9•4 years ago
|
||
== Change summary for alert #28874 (as of Mon, 22 Feb 2021 21:15:19 GMT) ==
Improvements:
Ratio | Suite | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|---|
197% | rasterflood_gradient | windows10-64-shippable-qr | e10s stylo webrender-sw | 455.50 -> 1,350.83 | |
179% | rasterflood_gradient | linux64-shippable-qr | e10s stylo webrender-sw | 488.33 -> 1,363.50 | |
161% | rasterflood_gradient | macosx1014-64-shippable-qr | e10s stylo webrender-sw | 408.08 -> 1,064.42 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=28874
Updated•4 years ago
|
Assignee | ||
Comment 10•4 years ago
|
||
Comment on attachment 9204505 [details]
Bug 1686244 - Avoid zero offset in radial gradient.
Beta/Release Uplift Approval Request
- User impact if declined: Trying to do partial SW-WR rollout on Linux. Would like to avoid people reporting significant performance regressions months down the line.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Only impacts SW-WR/Linux. We can abort the rollout if unstable. Adequate time to deal with any bugs.
- String changes made/needed:
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 11•4 years ago
|
||
Comment on attachment 9204124 [details]
Bug 1686244 - Accelerate linear gradients in SWGL. r?jrmuizel
Approved for 87.0b3.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 12•4 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/a35a81c995c0
https://hg.mozilla.org/releases/mozilla-beta/rev/f1551c87765c
https://hg.mozilla.org/releases/mozilla-beta/rev/be0f0e9ba18c
https://hg.mozilla.org/releases/mozilla-beta/rev/86ad69ab8ba3
Assignee | ||
Comment 13•4 years ago
|
||
This just reorders some checks to fail against NaNs and also checks for finiteness.
Comment 14•4 years ago
|
||
Comment 15•4 years ago
|
||
bugherder |
Assignee | ||
Comment 16•4 years ago
|
||
Comment on attachment 9205247 [details]
Bug 1686244 - Handle degenerate linear gradients. r?aosmond
Beta/Release Uplift Approval Request
- User impact if declined: Fixes potential crashes related to degenerate gradients we discovered in local mochitest runs.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Just a crash fix for the feature uplift here.
- String changes made/needed:
Comment 17•4 years ago
|
||
Comment on attachment 9205247 [details]
Bug 1686244 - Handle degenerate linear gradients. r?aosmond
Approved for 87.0b4.
Comment 18•4 years ago
|
||
bugherder uplift |
Updated•4 years ago
|
Description
•