Closed Bug 1435648 Opened 7 years ago Closed 7 years ago

Reduce the cost of allocating the ClippedDisplayItems array

Categories

(Core :: Web Painting, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

This shows up a fair bit in profiles when the display list is long (like the displaylist_mutate talos test)
Priority: -- → P3
These two arrays are more or less identical, so let's share storage for them.
Attachment #8948295 - Flags: review?(mstange)
Growing the array and moving the elements can be slow sometimes, let's use the size we had last paint to size the array upfront.
Attachment #8948296 - Flags: review?(mstange)
Attachment #8948296 - Attachment is patch: true
Blocks: 1436900
Comment on attachment 8948295 [details] [diff] [review] Part 1: Share storage with mAssignedDisplayItems Review of attachment 8948295 [details] [diff] [review]: ----------------------------------------------------------------- Would be nice to rename the cdi variables at some point in the future.
Attachment #8948295 - Flags: review?(mstange) → review+
Comment on attachment 8948296 [details] [diff] [review] Part 2: SetCapacity to the length we had last time Review of attachment 8948296 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/painting/FrameLayerBuilder.cpp @@ +1527,5 @@ > // DrawPaintedLayer, for example when progressive paint is enabled. > nsIntRegion mVisibilityComputedRegion; > > + // The number of items assigned to this layer on the previous paint. > + uint32_t mLastItemCount; size_t
Attachment #8948296 - Flags: review?(mstange) → review+
Pushed by mwoodrow@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/c95aade68024 Part 1: Share storage between mClippedDisplayItems and mAssignedDisplayItems. r=mstange https://hg.mozilla.org/integration/mozilla-inbound/rev/102c8a3bbaf6 Part 2: Preallocate the mAssignedDisplayItems array to the size it was last time. r=mstange
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
this landed with a few other patches from other bugs: https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=66c1c1596bea7cfb2316e78c940e52679b595efa&tochange=32bf2817fb7a4b35dc1cbb66ffac8e1f0658c68f here are some improvements: == Change summary for alert #11672 (as of Wed, 21 Feb 2018 07:45:26 GMT) == Improvements: 13% displaylist_mutate osx-10-10 opt e10s stylo 6,656.25 -> 5,807.67 8% displaylist_mutate windows10-64 opt e10s stylo 5,103.33 -> 4,672.75 7% displaylist_mutate windows10-64 pgo e10s stylo 4,516.71 -> 4,186.25 7% displaylist_mutate linux64 opt e10s stylo 2,781.08 -> 2,585.08 6% displaylist_mutate linux64 pgo e10s stylo 2,439.21 -> 2,281.83 For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=11672
Depends on: 1440966
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: