Closed
Bug 153754
Opened 22 years ago
Closed 22 years ago
nsPersistentProperties should use arena-allocated strings
Categories
(Core :: XPCOM, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla1.1beta
People
(Reporter: alecf, Assigned: alecf)
References
Details
(Whiteboard: fix in hand)
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
dougt
:
review+
dveditz
:
superreview+
|
Details | Diff | Splinter Review |
Right now, nsPersistentProperties uses both malloc-allocated strings and the
old-sk00l nspr hash tables.
Persistent properties are generally just read in as one big block, and then kept
around for the life of the object - this calls for an arena! While I'm there,
I'm switching over to PLDHashTable.
patch forthcoming.
Assignee | ||
Comment 1•22 years ago
|
||
This switches us over to arenas and PLDHashTable..
the other thing I did while I was there was to store property keys in char* -
since 99% of the time, they key is ASCII - however I did the right thing as
far as the UCS2/UTF8 conversion on the off chance that they key isn't ASCII.
at some point I'd like to switch this over entirely to ASCII keys, which means
dropping the whole use of NS_NewUTF8ConverterStream, but I'll get to that in
another bug.
Assignee | ||
Comment 2•22 years ago
|
||
(that conversion will be the subject of bug 121341)
dougt / dveditz, can I get a review here?
Assignee | ||
Comment 3•22 years ago
|
||
(Sorry for the additional bug spam)
ignore the printf and associated counting variables - I removed them from my
local tree and forgot to update the patch before attaching :(
Assignee | ||
Comment 4•22 years ago
|
||
oh, and this reduces number of string bundle-related allocations at startup from
about 1100 to about 20, including the actual string bundle objects, so we should
get some performance benefits here, we'll use less memory for the keys (500 or
so of average size 12 bytes reduced to 6 bytes, a savings of about 3k) and we'll
fragment the heap a whole lot less because all the old allocations were very
small strings (8-32 bytes for keys, 12-100 bytes for values)
Priority: -- → P2
Target Milestone: --- → mozilla1.1beta
Assignee | ||
Comment 5•22 years ago
|
||
duh, I wasn't including the null terminator in my ArenaStrdup()
Attachment #88865 -
Attachment is obsolete: true
Comment 6•22 years ago
|
||
Comment on attachment 89173 [details] [diff] [review]
updated patch - null terminate correctly
get rid of the printf's
looks fine
r=dougt
Attachment #89173 -
Flags: review+
Comment 7•22 years ago
|
||
Comment on attachment 89173 [details] [diff] [review]
updated patch - null terminate correctly
sr=dveditz
Attachment #89173 -
Flags: superreview+
Assignee | ||
Comment 8•22 years ago
|
||
yup, printf has been removed :)
fix is in!
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•