Closed Bug 1416073 Opened 2 years ago Closed 2 years ago

19% of WebRenderLayerManager::EndTransaction during MotionMark is in nsHTMLScrollFrame::ComputeScrollMetaData

Categories

(Core :: Graphics: WebRender, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox57 --- unaffected
firefox58 --- unaffected
firefox59 --- fixed

People

(Reporter: jrmuizel, Assigned: kats)

References

(Blocks 1 open bug)

Details

(Whiteboard: [wr-mvp])

Attachments

(1 file)

It seems like we do this work once per moving rectangle. Perhaps we can just do it once?
I assume this is happening because of the call site at [1] rather than from ScrollingLayersHelper. Should be easy to fix with a temp cache.

[1] https://searchfox.org/mozilla-central/rev/30ead7d1ae5bf95b8bc0fd67b950cd46ca05e32c/gfx/layers/wr/WebRenderScrollData.cpp#88
I wrote a patch. Uncompiled locally but here's a try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ba76bc23debcf282e9ede8aa0415eab0cef0a7bb

This should reduce it significantly. If the ViewIDForASR call still shows up a significant cost in the profile (a la bug 1412112) I can add an std::unordered_map<ActiveScrolledRoot*,FrameMetrics::ViewID> somewhere to speed it up, and reuse that cache across both WebRenderScrollData stuff and ScrollingLayerHelper per-transaction. I can do it in bug 1412112 if you think it'll help.
Assignee: nobody → bugmail
Status: NEW → ASSIGNED
Priority: P2 → P1
Whiteboard: [wr-mvp]
Comment on attachment 8927289 [details]
Bug 1416073 - Avoid calling the expensive ComputeScrollMetadata function if we already computed that metadata before.

https://reviewboard.mozilla.org/r/198604/#review204356
Attachment #8927289 - Flags: review?(jmuizelaar) → review+
Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dc46db3919a0
Avoid calling the expensive ComputeScrollMetadata function if we already computed that metadata before. r=jrmuizel
https://hg.mozilla.org/mozilla-central/rev/dc46db3919a0
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.