Closed Bug 105071 Opened 23 years ago Closed 23 years ago

nsXULElement should use nsCheapVoidArray for its children

Categories

(Core :: XUL, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla0.9.6

People

(Reporter: waterson, Assigned: waterson)

References

(Blocks 1 open bug)

Details

(Keywords: memory-footprint)

Attachments

(2 files)

nsXULElement uses nsVoidArray for its children, which burns two words due to the nsVoidArray's vtable. We should use nsCheapVoidArray (which rjesup is moving to XPCOM and renaming nsSmallVoidArray) to save a word here.
Blocks: 104400
Status: NEW → ASSIGNED
Depends on: 100231
Keywords: footprint
Priority: -- → P3
Target Milestone: --- → mozilla0.9.6
Comment on attachment 53761 [details] [diff] [review] use nsCheapVoidArray instead of nsVoidArray in nsXULElement sr=jst
Attachment #53761 - Flags: superreview+
Comment on attachment 53761 [details] [diff] [review] use nsCheapVoidArray instead of nsVoidArray in nsXULElement r=brendan@mozilla.org
Attachment #53761 - Flags: review+
r=rjesup@wgate.com Note that this may or may not actually save us any space, depending on the allocation granularity and the previous/new size of nsXULElement (or subclasses thereof). I'm sure everyone here knows this, of course. Also, it probably cost will cost us space if it's common for nsXULElements to have more than 1 child. If the distribution is heavily weighted to 0 elements and 1 element isn't too much more frequent than the larger values, then nsVoidArray * is more appropriate for CPU use reasons. What's the distribution of children of nsXULElements?
Attached patch !@#$% REQUIRES (deleted) — Splinter Review
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: