gecko-dev/layout
Timothy Nikkel 64e0a7e0fd Bug 1872487. Create less WebRenderLayerScrollData. r=botond
In order to create less WebRenderLayerScrollData currently we use a deferred transform item

https://searchfox.org/mozilla-central/rev/593c49fa812ceb4be45fcea7c9e90d15f59edb70/gfx/layers/wr/StackingContextHelper.h#82

We don't need a WebRenderLayerScrollData for every transform because a lot of transforms don't contain any ASRs, so the created WebRenderLayerScrollData would be useless.

However this optimization can lead to us creating a lot more WebRenderLayerScrollData later if the transform does contain ASRs. For example, if there is a transform, and then inside that is a ASR, and inside the ASR is a lot of small transforms, we end up having to create a WebRenderLayerScrollData for every little transform which don't contain any ASRs. This is doing the opposite of what the optimization intended.

WebRenderLayerScrollData creation happens during the CreateWebRenderCommands phase, so the display list build phase is complete, and we can tell cheaply if a transform contains any ASRs during display list building. So we just record that and use that to inform our decision about when to defer the transform item or not.

This optimization drastically reduces the total number of WebRenderLayerScrollData that we create during a full run of speedometer3 (summing the number created each paint over every paint). In my testing it went from 12-13k to 2-3k. Mostly subtests fell into two buckets: a single digit number of WebRenderLayerScrollData to begin with and this patch didn't change that, and 100 WebRenderLayerScrollData down to single digits after this patch. So the savings are concentrated in a few subtests that hit the described behaviour above.

I compared a profile before and after this patch of 10 runs of speedometer3, this patch saved 100 samples/ms serializing WebRenderLayerScrollData, which was what I expected based on how long serialization took before the patch combined with how many WebRenderLayerScrollData we were avoiding. The whole run took about 100,000 samples/ms, so this should hopefully be good for about 0.1% improvment. There is also potential savings in other areas outside of serialization step but that was a little harder to measure.

Differential Revision: https://phabricator.services.mozilla.com/D197446
2024-02-29 06:46:45 +00:00
..
base Bug 1880594 - Make PresShell::EventHandler dispatch mouse events as a default action of eTouchEnd if it's dispatched without APZ r=smaug 2024-02-27 01:25:51 +00:00
build Bug 1881188 - Remove nsLayoutCID.h r=emilio 2024-02-21 13:04:30 +00:00
docs
forms Bug 1878401 - part 7 - Pass BrowsingContext to nsIFilePicker::Init in tests r=extension-reviewers,settings-reviewers,credential-management-reviewers,anti-tracking-reviewers,devtools-reviewers,sgalich,pbz,nchevobbe,zombie,migration-reviewers,mconley 2024-02-28 21:29:39 +00:00
generic Bug 1872487. Create less WebRenderLayerScrollData. r=botond 2024-02-29 06:46:45 +00:00
inspector Bug 1815186 - Add ColorTo to InspectorUtils to convert color to other color spaces. r=emilio,layout-reviewers,supply-chain-reviewers 2024-02-26 14:55:01 +00:00
ipc
mathml Bug 1874823 - Make nsBlockFrame::Init set NS_BLOCK_STATIC_BFC by checking classes. r=layout-reviewers,AlaskanEmily 2024-01-24 12:13:42 +00:00
media
painting Bug 1872487. Create less WebRenderLayerScrollData. r=botond 2024-02-29 06:46:45 +00:00
printing Backed out changeset 4641c3dcf0c3 (bug 1876538) for causing mochitest-chrome failures on test_animation_observers_async.html. CLOSED TREE 2024-01-26 19:21:35 +02:00
reftests Bug 1816628 Part 1 - Account for horizontal overflow caused by text-shadow r=jfkthame 2024-02-28 18:51:23 +00:00
style Bug 1856640: Ensure layout flush for as-of-yet reflowed frames when querying computed style of elements potentially matching container query. r=firefox-style-system-reviewers,emilio 2024-02-27 17:48:07 +00:00
svg Bug 1816628 Part 2 - Make text-shadow react to stroke properties and fill opacity r=jfkthame 2024-02-28 18:51:23 +00:00
tables Bug 1879731: Address clang-tidy concerns in BCMapCellIterator. r=layout-reviewers,emilio 2024-02-27 15:55:40 +00:00
tools Bug 1878401 - part 6 - Update nsIFilePicker users in layout/ to pass BrowsingContext to init r=tnikkel 2024-02-28 21:29:39 +00:00
xul Bug 1879538 - cleanup unnecessary and redundant reftest conditions. r=aryx,jgilbert 2024-02-22 23:04:45 +00:00
moz.build