Closed Bug 1364813 Opened 7 years ago Closed 5 months ago

Devirtualize nsIFrame::IsFrameOfType()

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: emilio)

References

(Blocks 2 open bugs)

Details

(Keywords: perf, Whiteboard: [sp3])

Attachments

(1 file)

It *might* be a good idea to flatten this hierarchy and store the flags
for each concrete frame class in an array indexed by mClass.
I haven't looked at the implementation details yet though...
IsFrameOfType shows up as 3% of bug 1376536...  Perhaps this is worth doing.
Blocks: 1376536
(In reply to :Ehsan Akhgari from comment #1)
> IsFrameOfType shows up as 3% of bug 1376536...  Perhaps this is worth doing.

I don't think this is connected to bug 1376536 anymore - in a profile I captured there yesterday, IsFrameOfType only shows up as 1ms (https://perfht.ml/2zEBRHk) vs. a total of 213ms of samples that have "reflow" in the backtrace ( https://perfht.ml/2zDnwdW )  So: it's less than 0.5% of our reflow time, and doesn't seem significant enough that optimizing it away would make any sort of dent in that bug.

 --> Removing the dependency, in part because that bug's about to be fixed by some work done in a different helper.
No longer blocks: 1376536

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: MatsPalmgren_bugz → nobody
Severity: normal → S3

This is probably worth doing, and other engines seem to report wins in speedometer while doing the equivalent work.

Blocks: speedometer3
Flags: needinfo?(emilio)

Extend the per-frame-class bit we have to devirtualize IsLeaf to also
devirtualize IsFrameOfType.

This was done by going through all the frame classes, trying to preserve
behavior.

The only quirky thing is that I had to add two more trivial frame
classes, nsAudioFrame for audio elements, and
nsFloatingFirstLetterFrame. That's because these frame classes were
returning different answers at runtime, but they do this only on
conditions that trigger frame reconstruction (floating, and being an
audio element, respectively).

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Attachment #9365497 - Attachment description: Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. r=dholbert,jwatt,#layout → Bug 1364813 - Remove IsFrameOfType, use non-virtual checks.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)

This is probably worth doing, and other engines seem to report wins in speedometer while doing the equivalent work.

Thanks for doing this. Fingers crossed!

Attachment #9365497 - Attachment description: Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. → WIP: Bug 1364813 - Remove IsFrameOfType, use non-virtual checks.
Attachment #9365497 - Attachment description: WIP: Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. → Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. r=jwatt
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ef11a45be803
Remove IsFrameOfType, use non-virtual checks. r=jwatt
Regressions: 1866702
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
Whiteboard: [sp3]
No longer regressions: 1866702
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: