Various frame building optimizations
Categories
(Core :: Graphics: WebRender, enhancement, P3)
Tracking
()
People
(Reporter: nical, Assigned: nical)
References
(Blocks 1 open bug)
Details
Attachments
(18 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 3•5 years ago
|
||
These vectors are rebuilt once per frame. we can't recycle them because they are sent to the renderer. On a 4k screen for most sites the element counts are low enough that we can get away with preallocation from a pessimistic estimate, but high enough that reallocation happens a few times per frame and takes a small but visible portion of the profile.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
Tested this on a few pages and it lets us avoid allocating per-item rects for roughly a quarter to a third of the batches. For batches that end up allocating per item rects we get to allocate fewer of them. It also further reduces the amount of times we need to test all item rects against intersections.
Assignee | ||
Comment 5•5 years ago
|
||
Comment 6•5 years ago
|
||
bugherder |
Comment 8•5 years ago
|
||
bugherder |
Assignee | ||
Comment 9•5 years ago
|
||
An alternative patch to take only if we don't land https://phabricator.services.mozilla.com/D79545
The main observations here are:
- In the vast majority of times we find a compatible bacth or intersect an incompatible one within 3 iterations when looking for batch candidates.
- In addition, most of the time we don't need to iterate per-item rects thanks to a fast path kleveraging per-batch bounding rects, making it reasonably cheap to iterate over more batches.
This gives us room to allow ourselves to visit a lot more batches without a large impact on CPU time (under the assumption that removing a handful of draw calls will more than make up for the extra iterations).
Depends on D79479
Comment 10•5 years ago
|
||
Assignee | ||
Comment 11•5 years ago
|
||
This vector is usually small, but on some pages it can be fairly large (500+ in https://forum.xda-developers.com/redmi-note-3/development for example).
Assignee | ||
Comment 12•5 years ago
|
||
Depends on D79855
Assignee | ||
Comment 13•5 years ago
|
||
Depends on D79857
Comment 14•5 years ago
|
||
bugherder |
Comment 15•5 years ago
|
||
Comment 16•5 years ago
|
||
Comment 17•5 years ago
|
||
Backed out for WebRender bustages.
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=306558646&repo=autoland
Backout: https://hg.mozilla.org/integration/autoland/rev/a184a8ccba8b70900a24b3189570ee167ba957b3
Comment 18•5 years ago
|
||
bugherder |
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 19•5 years ago
|
||
This change just restructures the recycling added in previouscommits.
Assignee | ||
Comment 20•5 years ago
|
||
Depends on D80096
Updated•5 years ago
|
Assignee | ||
Comment 21•5 years ago
|
||
Depends on D80178
Assignee | ||
Comment 22•5 years ago
|
||
Depends on D80192
Assignee | ||
Comment 23•5 years ago
|
||
This patch a simple utility to help with pre-allocating vectors that we can't recycle and use it with the primitive headers.
Depends on D80193
Assignee | ||
Comment 24•5 years ago
|
||
Vector reallocations in CompositeState::push_surface are taking about 2% of total frame building time before this patch. There was an effort at preallocating some with constant values but I suspect these constants haven't been updated along with picture cachign heuristics.
Depends on D80194
Assignee | ||
Comment 25•5 years ago
|
||
Comment 26•5 years ago
|
||
Assignee | ||
Comment 27•5 years ago
|
||
Assignee | ||
Comment 28•5 years ago
|
||
Depends on D80437
Comment 29•5 years ago
|
||
Backed out 7 changesets (Bug 1642629) for causing multiple failures and crashes CLOSED TREE
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=307049171&repo=autoland
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=307038692&repo=autoland&lineNumber=110373
Backout: https://hg.mozilla.org/integration/autoland/rev/fa015682f65310416d2a40a146a7e8d004dd81d7
Assignee | ||
Comment 30•5 years ago
|
||
It would be wasteful to preallocate all batch builders because the majority of them have only a single batch, while typically only one will will have many batches. Thankfully we can acurately guess which pictures will produce many batches by checking whether they have more than one cluster.
Assignee | ||
Updated•5 years ago
|
Comment 31•5 years ago
|
||
Comment 32•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/93505e39bf57
https://hg.mozilla.org/mozilla-central/rev/9c4d5596e220
https://hg.mozilla.org/mozilla-central/rev/6203b2994812
https://hg.mozilla.org/mozilla-central/rev/dc3d4d706d11
https://hg.mozilla.org/mozilla-central/rev/d7ddc0cdffa2
https://hg.mozilla.org/mozilla-central/rev/7cbc9b5f00f1
https://hg.mozilla.org/mozilla-central/rev/f26158a3994c
https://hg.mozilla.org/mozilla-central/rev/ac1dec27b771
https://hg.mozilla.org/mozilla-central/rev/1e531a6c2590
https://hg.mozilla.org/mozilla-central/rev/a16036b4b36c
https://hg.mozilla.org/mozilla-central/rev/17684b39b0ba
https://hg.mozilla.org/mozilla-central/rev/e891a846e7f3
https://hg.mozilla.org/mozilla-central/rev/45ef8e463b6e
Assignee | ||
Updated•5 years ago
|
Description
•