Closed Bug 2092636 Opened 15 days ago Closed 14 days ago

Skip frame destruction bookkeeping when there is nothing to remove

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: jjaschke, Assigned: jjaschke)

References

(Blocks 1 open bug)

Details

(Keywords: perf-alert)

Attachments

(1 external file)

Destroying a frame does three lookups that are often unnecessary:

  • OverflowChangedTracker::RemoveFrame computes GetDepthInFrameTree(), an ancestor walk, before it notices that it tracks no frames at all.
  • PresShell::RemoveFrameFromApproximatelyVisibleList looks the frame up in mApproximatelyVisibleFrames even when that table is empty.
  • nsIFrame::RemoveDisplayItemDataForDeletion looks up the retained display list builder and removes the frame from its data. But a frame only has an entry in that data while it is modified (IsFrameModified()) or has an override dirty region (HasOverrideDirtyRegion()): those are the only two places that insert entries, and both bits are cleared only after the data has been cleared. A frame with neither bit and no display items has nothing to remove.

Returning early in these cases does not change behavior. It matters when large subtrees are removed, which Speedometer 3 does repeatedly (removing todo items, replacing chart content). On a local node-removal micro-benchmark the three changes together made removing blocks of HTML 1-12% faster and removing SVG content 24-32% faster.

Removing a frame from the overflow tracker, the approximately visible list and
the retained display list data each did a lookup (or an ancestor walk) even
when there was nothing to remove.

Assignee: nobody → jjaschke
Status: NEW → ASSIGNED
Pushed by jjaschke@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/aa26cef6e7cf https://hg.mozilla.org/integration/autoland/rev/6600e416403c Skip frame destruction bookkeeping that has nothing to remove. r=layout-reviewers,emilio
Status: ASSIGNED → RESOLVED
Closed: 14 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch

Perfherder has detected a devtools performance change from push 6600e416403ce8338af4af1afce8dedd1d3c6903.

No action is required from the author; this comment is provided for informational purposes only.

Improvements Test Platform Options Absolute values [old vs new]
22% damp console.objectexpanded.close.DAMP (doc) linux2404-64-shippable e10s fission stylo webrender 44.46 ms -> 34.73 ms
16% damp custom.inspector.close.DAMP (doc) linux2404-64-shippable e10s fission stylo webrender 27.02 ms -> 22.82 ms
15% damp console.objectexpanded.close.DAMP (doc) macosx1500-aarch64-shippable e10s fission stylo webrender 14.23 ms -> 12.15 ms
13% damp console.objectexpanded.close.DAMP (doc) windows11-64-24h2-shippable e10s fission stylo webrender 28.31 ms -> 24.65 ms
11% damp custom.inspector.close.DAMP (doc) macosx1500-aarch64-shippable e10s fission stylo webrender 9.26 ms -> 8.25 ms
... ... ... ... ...
3% damp custom.netmonitor.bigdatarequests.navigate.DAMP (doc) macosx1500-aarch64-shippable e10s fission stylo webrender 112.07 ms -> 109.04 ms

Need Help or Information?

If you have any questions, please reach out to acseh@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

Keywords: perf-alert

Perfherder has detected a talos performance change from push 6600e416403ce8338af4af1afce8dedd1d3c6903.

No action is required from the author; this comment is provided for informational purposes only.

Improvement Test Platform Options Absolute values [old vs new]
20% perf_reftest_singletons remove-child-with-lengthy-text.html (doc) macosx1500-aarch64-shippable e10s fission stylo webrender 0.95 ms -> 0.76 ms
20% perf_reftest_singletons remove-child-with-lengthy-text.html (doc) linux2404-64-shippable e10s fission stylo webrender 1.30 ms -> 1.04 ms

Need Help or Information?

If you have any questions, please reach out to acseh@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

QA Whiteboard: [qa-triage-done-c163/b162]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: