Closed Bug 240559 Opened 21 years ago Closed 21 years ago

nsTableCellFrame::InitCellFrame does lots of unnecessary work

Categories

(Core :: Layout: Tables, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: bernd_mozilla)

Details

(Keywords: perf)

Attachments

(1 file, 2 obsolete files)

Two things here: 1) Why is this function calling GetTableFrame() ? It never uses it.... 2) SetColIndex sets the colindex on the content node, with mumbling about nsHTMLStyleSheet, but nsHTMLStyleSheet knows nothing about colindex. I think we can probably remove that QI and set, remove the colindex stuff from nsHTMLTableCellElement, and maybe remove the nsIHTMLTableCellElement interface.
isnt that nsI... interface heavily used by editor ?
No. See http://lxr.mozilla.org/seamonkey/search?string=nsIHTMLTableCellElement You may be thinking nsI_DOM_HTMLTableCellElement. Totally different beast.
sorry, I was looking for consumers of the GetColIndex as http://lxr.mozilla.org/seamonkey/source/layout/html/table/public/nsITableCellLayout.h and that is editor
Ah, right. That's implemented by nsTableCellFrame and doesn't involve the content node at all.
GetTableFrame() is the secret code to make sure the cellmap exists, Boris you know the cellmap good enough (are old enough...) that I can share this secret with you. Probably most of these GetTableFrame calls are bogus now as I placed in outer table frame a requirement that mInner != nsnull. I think we can remove the whole stuff I mean: - InitCellFrame - SetColIndex - and the content stuff - http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsIHTMLTableCellElement.h
That sounds perfect.
Attached patch patch (obsolete) — Splinter Review
One cannot remove SetColIndex on the frame. But we can remove that on the content node as nobody uses the data on the content node ( I believe so). This patch saves us one QI and 4 bytes per table cell. I also removed that GetSpanValue from the col frame that according to lxr and compile nobody uses.
taking the bug
Assignee: nobody → bernd_mozilla
Attached patch revised (obsolete) — Splinter Review
Attachment #146403 - Attachment is obsolete: true
Attachment #146404 - Flags: superreview?(bzbarsky)
Attachment #146404 - Flags: review?(bzbarsky)
And yes I will remove the nsIHTMLTable*.h files too.
Attached patch patchSplinter Review
there is even more to remove
Attachment #146408 - Flags: superreview?(bzbarsky)
Attachment #146408 - Flags: review?(bzbarsky)
Attachment #146404 - Attachment is obsolete: true
Attachment #146404 - Flags: superreview?(bzbarsky)
Attachment #146404 - Flags: review?(bzbarsky)
Comment on attachment 146408 [details] [diff] [review] patch First of all, this saves _8_ bytes per table cell -- one 32-bit member and one vtable pointer. ;) >Index: layout/html/table/src/nsTableCellFrame.h > virtual nsresult GetColIndex(PRInt32 &aColIndex) const; >- virtual nsresult SetColIndex(PRInt32 aColIndex); >+ void SetColIndex(PRInt32 aColIndex); No reason for GetColIndex to stay virtual, is there? r+sr=bzbarsky. Thanks for cleaning this up!
Attachment #146408 - Flags: superreview?(bzbarsky)
Attachment #146408 - Flags: superreview+
Attachment #146408 - Flags: review?(bzbarsky)
Attachment #146408 - Flags: review+
Ah, ok. Sounds good.
What effect will this have on bug 54542 ?
About 0.5% improvement.
fix checked in as Boris promised btek went up 0.5% :-). Markus its up to you to verify what impact it has on bug 54542 with tomorrows nightly. There have been a couple of performance related checkins that would deserve a quantitative estimate: the checkin for bug 236703 from 2004-04-12 the checkin for bug 240318 from 2004-04-12 and the change of background painting in quirks mode from 2004-04-18 neither of them did show significant changes in pageload. So Markus comming back with some real numbers might be helpfull.
> fix checked in as Boris promised btek went up 0.5% :-). It's been doing that randomly for a while... ;(
fix completely checked in
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: