Closed Bug 1373095 Opened 7 years ago Closed 7 years ago

nsTableCellFrame::GetRowSpan() is a tad slow

Categories

(Core :: Layout: Tables, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla56
Performance Impact low
Tracking Status
firefox56 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(1 file)

It's at ~1.5% on the perf log for the Netflix use case reported in bug 1373058,
which seems a bit too much.

GetRowSpan/GetColSpan are virtual because nsMathMLmtdFrame overrides it.
http://searchfox.org/mozilla-central/rev/c49a70b53f67dd5550eec8a08793805f2aca8d42/layout/mathml/nsMathMLmtableFrame.cpp#1170
It seems we could devirtualize these fairly easily, by adding that code
in an else-branch in the base class:
http://searchfox.org/mozilla-central/rev/c49a70b53f67dd5550eec8a08793805f2aca8d42/layout/tables/nsTableCellFrame.cpp#712

Or perhaps hookup <mtd> so that it parses the attr like <td>:
http://searchfox.org/mozilla-central/rev/c49a70b53f67dd5550eec8a08793805f2aca8d42/dom/html/HTMLTableCellElement.cpp#404
so that the existing code in nsTableCellFrame just works as is.
Whiteboard: [qf] → [qf:p3]
FYI, I intentionally skipped this HTML quirk:
http://searchfox.org/mozilla-central/rev/20d16dadd336e0c6b97e3e19dc4ff907744b5734/dom/html/HTMLTableCellElement.cpp#406-408
since we currently don't do that for MathML <mtd>.
Let me know if you think we should.
Attachment #8878496 - Flags: review?(bzbarsky)
Blocks: FastReflows
Comment on attachment 8878496 [details] [diff] [review]
Devirtualize GetRowSpan/GetColSpan

>+    if (IsMathMLElement(nsGkAtoms::mtd_)) {

No point testing the namespace again, given where we are.  Just use:

  if (mNodeInfo->Equals(nsGkAtoms::mtd_)) {

r=me
Attachment #8878496 - Flags: review?(bzbarsky) → review+
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c0bb73483afb
Devirtualize GetRowSpan/GetColSpan.  r=bz
https://hg.mozilla.org/mozilla-central/rev/c0bb73483afb
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Performance Impact: --- → P3
Whiteboard: [qf:p3]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: