Closed Bug 1363929 Opened 4 years ago Closed 4 years ago

nsIFrame::In3DContextAndBackfaceIsHidden could be faster

Categories

(Core :: Web Painting, enhancement)

x86
Windows 10
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

(Keywords: perf)

Attachments

(1 file)

I just profiled scrolling my facebook timeline.  I noticed about 0.15% of the time being spent in nsIFrame::Combines3DTransformWithAncestors being called from nsIFrame::In3DContextAndBackfaceIsHidden.

So In3DContextAndBackfaceIsHidden does two tests, both of which are likely to fail the vast majority of the time, separated by an &&.  I think the one that's currently *second* is likely to be the faster test, because BackfaceIsHidden() initially tests style data on the frame itself, whereas Combines3DTransformWithAncestors initially walks up to the parent frame and tests style data on it.  So I think the BackfaceIsHidden test is likely to fail faster simply due to less pointer chasing.
Attachment #8866587 - Flags: review?(matt.woodrow) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/0515ebda07af3263ab124ba1a6eabe212e9e1b89
Bug 1363929 - Swap the order of tests in nsIFrame::In3DContextAndBackfaceIsHidden so that the faster-to-fail one is first.  r=mattwoodrow
https://hg.mozilla.org/mozilla-central/rev/0515ebda07af
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.