Closed
Bug 108597
Opened 23 years ago
Closed 23 years ago
shrink nsStr
Categories
(Core :: XPCOM, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla0.9.6
People
(Reporter: alecf, Assigned: alecf)
References
Details
(Whiteboard: fix in hand)
Attachments
(1 file)
(deleted),
patch
|
jag+mozilla
:
review+
|
Details | Diff | Splinter Review |
Man! Has anyone noticed that:
1) nsStr counts for 10M out of 25M in the bloat logs
2) nsStr is 20 bytes long
3) 8 bytes of nsStr are used for two booleans (mCharSize and mOwnsBuffer)
With a simple 10-15 line change, I can shrink nsStr to 16 bytes, by making
mCharSize a PRInt8 and making mOwnsBuffer a PRPackedBool, both 8 bytes. Rounded
up to the nearest 4 bytes, these two variables still take 4 bytes, but it will
save about 2 Megs in the bloat logs on tinderbox.
I'm going to work on further reductions to roll these two boolean variables into
the high bytes of mLength and mCapacity, reducing this object to a mere 8 bytes,
but I'd like to get this short patch into 0.9.6 right now.
Assignee | ||
Comment 1•23 years ago
|
||
oops, assign to myself, I have the fix
Assignee: dougt → alecf
Priority: -- → P1
Target Milestone: --- → mozilla0.9.6
Assignee | ||
Comment 2•23 years ago
|
||
Assignee | ||
Comment 3•23 years ago
|
||
I totally mucked up indentation in nsStr.h, but I'll fix that before landing.
Assignee | ||
Comment 4•23 years ago
|
||
cc'ing waterson for an sr=
Updated•23 years ago
|
Attachment #56622 -
Flags: superreview+
Comment 5•23 years ago
|
||
sr=waterson
Comment 6•23 years ago
|
||
Comment on attachment 56622 [details] [diff] [review]
shrink nsStr by 4 bytes
Sure, low fruit. r=jag
Attachment #56622 -
Flags: superreview+ → review+
Assignee | ||
Updated•23 years ago
|
Whiteboard: fix in hand
Assignee | ||
Comment 7•23 years ago
|
||
in my tree, I also moved mCharSize and mOwnsBuffer after mStr/mUStr to make sure
mStr/mUStr stay aligned (dumb compilers might not)
Status: NEW → ASSIGNED
Assignee | ||
Comment 8•23 years ago
|
||
thanks guys, fixed!
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•