Closed
Bug 105068
Opened 23 years ago
Closed 23 years ago
merge mLazyState bits to save a word in slots
Categories
(Core :: XUL, defect, P3)
Core
XUL
Tracking
()
RESOLVED
FIXED
mozilla0.9.9
People
(Reporter: waterson, Assigned: waterson)
References
(Blocks 1 open bug)
Details
(Keywords: memory-footprint)
Attachments
(2 files)
(deleted),
patch
|
shaver
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
shaver
:
review+
hyatt
:
superreview+
|
Details | Diff | Splinter Review |
The mLazyState field is used by XUL generated from RDF templates. Since these
nodes are all going to be ``heavyweight'' anyway, there is no reason to store
this value in the ``lightweight'' part of the XUL element. (Well, the topmost
node in every template also uses the lazy state, so we'd be faulting these nodes
-- but the number of these nodes is extremely small.)
Assignee | ||
Updated•23 years ago
|
Assignee | ||
Comment 1•23 years ago
|
||
Assignee | ||
Comment 2•23 years ago
|
||
So, when bringing up a browser window, 14 out of 1750 nsXULElement objects get
their lazy state set: all of these are lightweights. There are 926 heavyweights.
nsXULElement is currently (before patch) 17 words, nsXULElements::Slots is 7
words. That means are memory usage is:
1750 * 17 + 926 * 7 = 36232 words
With the patch, nsXULElement is 16 words, nsXULElements::Slots is 8 words:
1750 * 16 + (926 + 14) * 8 = 35520 words
That's a net savings of 712 words, or about 2%.
Hmm. Maybe we should stuff this state into the low bits of a pointer somewhere,
so we'd get
1750 * 16 + (926 + 14) * 7 = 34580 words
to save 1652 words, or about 4.5%.
Assignee | ||
Comment 3•23 years ago
|
||
Bah, that'd be great to do, but I'll do it once I clean out all the other cruft
from the slots.
Comment on attachment 54042 [details] [diff] [review]
move mLazyState to nsXULElement::Slots
r=shaver. How many bits are used in mLazyState, anyway?
Attachment #54042 -
Flags: review+
Assignee | ||
Comment 5•23 years ago
|
||
Three. But I'd like to review their usage, too. A lot of that stuff was cooked
up on too much caffeine and may be unnecessary.
Comment 6•23 years ago
|
||
sr=hyatt
Assignee | ||
Comment 7•23 years ago
|
||
Okay, I've checked in attachment 54042 [details] [diff] [review]. I'll leave this open as a reminder to
merge bits once stuff has been cleaned up a bit more.
Assignee | ||
Updated•23 years ago
|
Summary: move nsXULElement::mLazyState to slots → merge mLazyState bits to save a word in slots
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.6 → mozilla0.9.7
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.7 → mozilla0.9.8
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.8 → mozilla0.9.9
Assignee | ||
Comment 8•23 years ago
|
||
To save another word in the mSlots, this patch collapses mLazyState and
mAttributes: mLazyState takes the low three bits, mAttributes takes the high
bits.
Comment on attachment 66021 [details] [diff] [review]
collapse mAttributes and mLazyState
I tried really hard to find something to complain about here, and came up
empty.
I guess that means r=shaver.
Attachment #66021 -
Flags: review+
Comment 10•23 years ago
|
||
Comment on attachment 66021 [details] [diff] [review]
collapse mAttributes and mLazyState
sr=hyatt
Attachment #66021 -
Flags: superreview+
Assignee | ||
Comment 11•23 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 12•23 years ago
|
||
To be 64-bit safe, you want
+#define LAZYSTATE_MASK (((JSWord)1 << LAZYSTATE_BITS) - 1)
+#define ATTRIBUTES_MASK (~LAZYSTATE_MASK)
(note the (JSWord)1 rather than 1 in the first line).
/be
Assignee | ||
Comment 13•23 years ago
|
||
Just made that change. Thanks.
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.
Description
•