Closed Bug 360870 Opened 18 years ago Closed 18 years ago

[FIX]Consider eliminating the arithmetic in GetStyleData

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

I tried replacing some of the GetStyleData callsites with GetStyle**** functions I added using our macro stuff.  This allows getting a style struct without having to do a bunch of pointer arithmetic, at the expense of multiple functions around...

This patch seems to give maybe a 1% speedup on large table pages (which is where I was seeing a lot of GetStyleData going on).  I think it's worth at least trying on trunk.
Attached patch Like so (obsolete) — Splinter Review
Attachment #245734 - Flags: superreview?(dbaron)
Attachment #245734 - Flags: review?(dbaron)
Comment on attachment 245734 [details] [diff] [review]
Like so

How hard would it be to eliminate the GetStyleData(nsStyleStructID) APIs?  What still uses them?  I'm not crazy about the idea of keeping both APIs around.

r+sr=dbaron
Attachment #245734 - Flags: superreview?(dbaron)
Attachment #245734 - Flags: superreview+
Attachment #245734 - Flags: review?(dbaron)
Attachment #245734 - Flags: review+
That said, I'd like to make nsRuleNode more table driven to implement some advanced css3-values features (see bug 332335 and dependencies), so I may want to revert part of the nsRuleNode changes here at some point.
The main consumers of GetStyleData left after this change are computed style (which would need some thought to fix) and nsRuleNode itself -- WalkRuleTree calls it on the parent style context.  That one is the really tough one.
Attached patch Merged to tipSplinter Review
Attachment #245734 - Attachment is obsolete: true
Filed bug 363605 on computed style, and checked in.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: