nsTableCellFrame::GetRowSpan() is a tad slow

RESOLVED FIXED in Firefox 56

Status

()

P3
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: mats, Assigned: mats)

Tracking

(Blocks: 2 bugs, {perf})

Trunk
mozilla56
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox56 fixed)

Details

(Whiteboard: [qf:p3])

Attachments

(1 attachment)

(Assignee)

Description

a year ago
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]
(Assignee)

Comment 2

a year ago
Created attachment 8878496 [details] [diff] [review]
Devirtualize GetRowSpan/GetColSpan

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)
(Assignee)

Updated

a year ago
Blocks: 1341750
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+

Comment 5

a year ago
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
Last Resolved: a year ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.