Closed Bug 639231 Opened 13 years ago Closed 13 years ago

separate reset and inherited nsStyleStructID (SID) ranges and store structs in arrays-by-SID rather than structures

Categories

(Core :: CSS Parsing and Computation, defect, P4)

defect

Tracking

()

RESOLVED FIXED
mozilla5

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

(Keywords: perf)

Attachments

(3 files)

In bug 636039, comment 5, I wrote:
>Another thing I realized I can do to make things faster:  reorder style struct
>IDs so the inherited and reset structs have separate ID ranges, and then use
>the IDs as indices into an array in ns{Inherited,Reset}StyleData.

I'm filing this bug on doing that rather than having it all in bug 636039.
See bug 636039 comment 11 for performance metrics for these patches.
Comment on attachment 517201 [details] [diff] [review]
patch 1: keep reset and inherited style structs IDs separate

Please document that the DUMMY1 and DUMMY2 thing are needed so that the presence of Inherited_Start and Reset_Start won't mess up the actual struct numbering.

r=me
Attachment #517201 - Flags: review?(bzbarsky) → review+
Comment on attachment 517202 [details] [diff] [review]
patch 2: fix wacky indentation

r=me
Attachment #517202 - Flags: review?(bzbarsky) → review+
One note:  The only remaining instance of STYLE_STRUCT_TEST is the Compute*Data calls in WalkRuleTree.  Is there a reason not to just replace that with an array of function pointers?
Comment on attachment 517203 [details] [diff] [review]
patch 3: make nsCachedStyleData store arrays indexed by SID

r=me
Attachment #517203 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/36b78471344f
https://hg.mozilla.org/mozilla-central/rev/b0d6f4e17e2d
https://hg.mozilla.org/mozilla-central/rev/329c13fec602
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Priority: -- → P4
Resolution: --- → FIXED
Whiteboard: fixed-in-birch
Target Milestone: --- → mozilla2.2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: