gecko-dev/layout/generic
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
..
crashtests Bug 1879538 - cleanup unnecessary and redundant reftest conditions. r=aryx,jgilbert 2024-02-22 23:04:45 +00:00
test Bug 1878346: Avoid intermittent test failures in test_bug514732-2.xhtml by flushing layout before setting up MozScrolledAreaChanged event-handler. r=layout-reviewers,emilio 2024-02-02 19:37:18 +00:00
AnonymousContentKey.h
AspectRatio.cpp
AspectRatio.h
AutoCopyListener.h
BlockReflowState.cpp Bug 1684236 - Implement 'align-content' on block containers. r=layout-reviewers,jfkthame 2024-02-27 16:32:02 +00:00
BlockReflowState.h Bug 1684236 - Implement 'align-content' on block containers. r=layout-reviewers,jfkthame 2024-02-27 16:32:02 +00:00
BRFrame.cpp
broken-image.png
ColumnSetWrapperFrame.cpp 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
ColumnSetWrapperFrame.h
ColumnUtils.cpp
ColumnUtils.h
CSSAlignUtils.cpp
CSSAlignUtils.h
CSSOrderAwareFrameIterator.cpp
CSSOrderAwareFrameIterator.h
folder.png
frame-graph.py
FrameClass.py
FrameClasses.py
GenerateFrameLists.py
jar.mn
JustificationUtils.h
LayoutMessageUtils.h
MathMLTextRunFactory.cpp
MathMLTextRunFactory.h
MiddleCroppingBlockFrame.cpp
MiddleCroppingBlockFrame.h
moz.build
nsAbsoluteContainingBlock.cpp
nsAbsoluteContainingBlock.h
nsAtomicContainerFrame.h
nsBackdropFrame.cpp
nsBackdropFrame.h
nsBlockDebugFlags.h
nsBlockFrame.cpp Bug 1684236 - Implement 'align-content' on block containers. r=layout-reviewers,jfkthame 2024-02-27 16:32:02 +00:00
nsBlockFrame.h Bug 1684236 - Implement 'align-content' on block containers. r=layout-reviewers,jfkthame 2024-02-27 16:32:02 +00:00
nsBlockReflowContext.cpp
nsBlockReflowContext.h
nsCanvasFrame.cpp Bug 1878433 Part 3 - Sort #includes in nsCanvasFrame.cpp, and removed some unused ones. r=dholbert 2024-02-03 01:30:39 +00:00
nsCanvasFrame.h
nsColumnSetFrame.cpp
nsColumnSetFrame.h
nsContainerFrame.cpp Bug 1879579 - Clean up CompareTreePosition and related code. r=smaug 2024-02-12 20:01:36 +00:00
nsContainerFrame.h
nsContainerFrameInlines.h
nsDirection.h
nsFirstLetterFrame.cpp
nsFirstLetterFrame.h
nsFlexContainerFrame.cpp
nsFlexContainerFrame.h
nsFloatManager.cpp
nsFloatManager.h
nsFontInflationData.cpp
nsFontInflationData.h
nsFrameList.cpp Bug 1865012 Part 2 - Add nsFrameList::RemoveLastChild, and destroy frame list in reverse order. r=dholbert 2024-01-23 23:15:02 +00:00
nsFrameList.h Bug 1865012 Part 2 - Add nsFrameList::RemoveLastChild, and destroy frame list in reverse order. r=dholbert 2024-01-23 23:15:02 +00:00
nsFrameSelection.cpp Bug 1881188 - Remove nsLayoutCID.h r=emilio 2024-02-21 13:04:30 +00:00
nsFrameSelection.h
nsFrameSetFrame.cpp Bug 1878976 - Remove plugin-related code in EventStateManager; r=emilio 2024-02-07 12:35:27 +00:00
nsFrameSetFrame.h Bug 1878976 - Remove plugin-related code in EventStateManager; r=emilio 2024-02-07 12:35:27 +00:00
nsFrameState.cpp
nsFrameState.h
nsFrameStateBits.h
nsGfxScrollFrame.cpp Bug 1871760 - Revert bug 1856088. r=botond 2024-02-26 21:06:31 +00:00
nsGfxScrollFrame.h Bug 1878435 Part 2 - Add a helper computing scrollbar-gutter. r=emilio,layout-reviewers 2024-02-05 06:35:41 +00:00
nsGridContainerFrame.cpp Bug 1878846 - Take writing mode into account when calculating baseline sharing group. r=layout-reviewers,dholbert,emilio 2024-02-20 10:05:12 +00:00
nsGridContainerFrame.h Bug 1877943 - Remove GetFirstLineBaseline function from grid r=dshin 2024-02-05 09:28:30 +00:00
nsHTMLCanvasFrame.cpp Bug 1876541 - Factor out the common-to-all-elements intrinsic size steps to nsIFrame::FinishIntrinsicSize. r=TYLin 2024-02-07 09:39:33 +00:00
nsHTMLCanvasFrame.h
nsHTMLParts.h
nsIAnonymousContentCreator.h
nsIFrame.cpp Bug 1872487. Create less WebRenderLayerScrollData. r=botond 2024-02-29 06:46:45 +00:00
nsIFrame.h 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
nsIFrameInlines.h
nsILineIterator.cpp
nsILineIterator.h
nsImageFrame.cpp Bug 1560702 - Improve hit boxes of titlebar buttons. r=stransky,desktop-theme-reviewers,dao 2024-02-27 10:28:56 +00:00
nsImageFrame.h Bug 1878976 - Remove plugin-related code in EventStateManager; r=emilio 2024-02-07 12:35:27 +00:00
nsImageMap.cpp Bug 1878211 - Process pairs in coord list in PolyArea. r=dholbert 2024-02-08 04:03:58 +00:00
nsImageMap.h
nsInlineFrame.cpp
nsInlineFrame.h
nsIntervalSet.cpp
nsIntervalSet.h
nsIScrollableFrame.h
nsIScrollPositionListener.h
nsIStatefulFrame.h
nsLeafFrame.cpp
nsLeafFrame.h
nsLineBox.cpp Backed out 4 changesets (bug 1865012) for causing mochitest failure on test_gencontent.html CLOSED TREE 2024-01-23 02:17:49 +02:00
nsLineBox.h
nsLineLayout.cpp Bug 1872929 - Don't allow text-wrap:balance adjustment to cause an overflow-wrap line break to be used. r=layout-reviewers,emilio 2024-01-30 18:58:16 +00:00
nsLineLayout.h Bug 1872929 - Don't allow text-wrap:balance adjustment to cause an overflow-wrap line break to be used. r=layout-reviewers,emilio 2024-01-30 18:58:16 +00:00
nsPageContentFrame.cpp Bug 1877850 Part 1 - Convert callers of ReflowInput physical size accessors to use logical ones. r=dholbert 2024-02-01 22:02:00 +00:00
nsPageContentFrame.h Bug 1865012 Part 3 - Remove FirstContinuation overrides for nsPageFrame and nsPageContentFrame. r=dholbert 2024-01-23 23:15:02 +00:00
nsPageFrame.cpp Bug 1865012 Part 3 - Remove FirstContinuation overrides for nsPageFrame and nsPageContentFrame. r=dholbert 2024-01-23 23:15:02 +00:00
nsPageFrame.h Bug 1865012 Part 3 - Remove FirstContinuation overrides for nsPageFrame and nsPageContentFrame. r=dholbert 2024-01-23 23:15:02 +00:00
nsPageSequenceFrame.cpp
nsPageSequenceFrame.h
nsPlaceholderFrame.cpp
nsPlaceholderFrame.h
nsQueryFrame.h
nsRubyBaseContainerFrame.cpp
nsRubyBaseContainerFrame.h
nsRubyBaseFrame.cpp
nsRubyBaseFrame.h
nsRubyContentFrame.cpp
nsRubyContentFrame.h
nsRubyFrame.cpp
nsRubyFrame.h
nsRubyTextContainerFrame.cpp
nsRubyTextContainerFrame.h
nsRubyTextFrame.cpp
nsRubyTextFrame.h
nsSplittableFrame.cpp Bug 1865012 Part 1 - Make accessing first-continuation and first-in-flow constant time. r=dholbert 2024-01-23 23:15:01 +00:00
nsSplittableFrame.h Bug 1865012 Part 3 - Remove FirstContinuation overrides for nsPageFrame and nsPageContentFrame. r=dholbert 2024-01-23 23:15:02 +00:00
nsSubDocumentFrame.cpp Bug 1876541 - Factor out the common-to-all-elements intrinsic size steps to nsIFrame::FinishIntrinsicSize. r=TYLin 2024-02-07 09:39:33 +00:00
nsSubDocumentFrame.h Bug 1624118 - Fix various issues with view handling when loading <object> / <embed> as subdocuments. r=longsonr 2024-01-22 13:02:33 +00:00
nsTextFrame.cpp Bug 1816628 Part 2 - Make text-shadow react to stroke properties and fill opacity r=jfkthame 2024-02-28 18:51:23 +00:00
nsTextFrame.h Bug 1816628 Part 2 - Make text-shadow react to stroke properties and fill opacity r=jfkthame 2024-02-28 18:51:23 +00:00
nsTextFrameUtils.cpp
nsTextFrameUtils.h
nsTextPaintStyle.cpp
nsTextPaintStyle.h
nsTextRunTransformations.cpp
nsTextRunTransformations.h
nsVideoFrame.cpp Bug 1876541 - Factor out the common-to-all-elements intrinsic size steps to nsIFrame::FinishIntrinsicSize. r=TYLin 2024-02-07 09:39:33 +00:00
nsVideoFrame.h
PrintedSheetFrame.cpp
PrintedSheetFrame.h
ReflowInput.cpp Bug 1877850 Part 2 - Rewrite ComputedSizeAsContainerIfConstrained() using logical coordinates, and use it in BlockReflowState. r=dholbert 2024-02-01 22:02:01 +00:00
ReflowInput.h Bug 1877850 Part 2 - Rewrite ComputedSizeAsContainerIfConstrained() using logical coordinates, and use it in BlockReflowState. r=dholbert 2024-02-01 22:02:01 +00:00
ReflowOutput.cpp
ReflowOutput.h
RubyUtils.cpp
RubyUtils.h
ScrollAnchorContainer.cpp Bug 1871760 - Revert bug 1856088. r=botond 2024-02-26 21:06:31 +00:00
ScrollAnchorContainer.h
ScrollAnimationBezierPhysics.cpp
ScrollAnimationBezierPhysics.h
ScrollAnimationMSDPhysics.cpp
ScrollAnimationMSDPhysics.h
ScrollAnimationPhysics.h
ScrollbarActivity.cpp
ScrollbarActivity.h
ScrollbarPreferences.h
ScrollGeneration.cpp
ScrollGeneration.h
ScrollOrigin.h Bug 1871760 - Revert bug 1856088. r=botond 2024-02-26 21:06:31 +00:00
ScrollPositionUpdate.cpp Bug 1871760 - Revert bug 1856088. r=botond 2024-02-26 21:06:31 +00:00
ScrollPositionUpdate.h Bug 1871760 - Revert bug 1856088. r=botond 2024-02-26 21:06:31 +00:00
ScrollSnap.cpp
ScrollSnap.h
ScrollSnapInfo.cpp
ScrollSnapInfo.h
ScrollSnapTargetId.h
ScrollVelocityQueue.cpp
ScrollVelocityQueue.h
SelectionMovementUtils.cpp
SelectionMovementUtils.h
StickyScrollContainer.cpp
StickyScrollContainer.h
TextDrawTarget.h
TextOverflow.cpp Bug 1816628 Part 1 - Account for horizontal overflow caused by text-shadow r=jfkthame 2024-02-28 18:51:23 +00:00
TextOverflow.h
ViewportFrame.cpp Backed out 16 changesets (bug 1770944) as req by asuth. 2024-02-23 21:11:08 +02:00
ViewportFrame.h Bug 728807 - Adjust containing block origin for fixed positioned elements. r=layout-reviewers,emilio,dholbert 2024-01-26 17:08:04 +00:00
Visibility.h
WBRFrame.cpp
WritingModes.h