Closed
Bug 109129
Opened 23 years ago
Closed 18 years ago
NS_NewAtom shouldn't flatten string to hash it
Categories
(Core :: XPCOM, defect, P2)
Core
XPCOM
Tracking
()
RESOLVED
WORKSFORME
Future
People
(Reporter: dbaron, Assigned: dbaron)
Details
(Keywords: perf)
NS_NewAtom currently flattens a string to hash it. We need a hash function that
takes an nsAString& so we don't need to allocate. (This seems to be responsible
for about 2000 allocations on startup.)
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Updated•23 years ago
|
Priority: -- → P2
Target Milestone: --- → mozilla0.9.7
Assignee | ||
Comment 1•23 years ago
|
||
FWIW, the allocation sites are:
2033 operator new(unsigned long, const std::nothrow_t&)
operator new(unsigned long)
NS_AllocateContiguousHandleWithData ...
nsSharableString::assign(const nsAString&)
nsPromiseFlatString::nsPromiseFlatString(const nsAString&)
PromiseFlatString(const nsAString&)
GetAtomHashEntry(const nsAString&)
NS_NewAtom(const nsAString&)
nsXMLContentSink::SplitXMLName(const nsAString&, nsIAtom**, ...
nsXMLContentSink::AddAttributes(const nsIParserNode&, ...
nsXMLContentSink::OpenContainer(const nsIParserNode&)
648 operator new(unsigned long, const std::nothrow_t&)
operator new(unsigned long)
NS_AllocateContiguousHandleWithData ...
nsSharableString::assign(const nsAString&)
nsPromiseFlatString::nsPromiseFlatString(const nsAString&)
PromiseFlatString(const nsAString&)
GetAtomHashEntry(const nsAString&)
NS_NewAtom(const nsAString&)
nsXMLContentSink::SplitXMLName(const nsAString&, nsIAtom**, ...
nsXMLContentSink::OpenContainer(const nsIParserNode&)
276 operator new(unsigned long, const std::nothrow_t&)
operator new(unsigned long)
NS_AllocateContiguousHandleWithData ...
nsSharableString::assign(const nsAString&)
nsPromiseFlatString::nsPromiseFlatString(const nsAString&)
PromiseFlatString(const nsAString&)
GetAtomHashEntry(const nsAString&)
NS_NewAtom(const nsAString&)
nsXMLContentSink::SplitXMLName(const nsAString&, nsIAtom**, ...
nsXMLContentSink::AddAttributes(const nsIParserNode&, ...
nsXMLContentSink::OpenContainer(const nsIParserNode&)
194 operator new(unsigned long, const std::nothrow_t&)
operator new(unsigned long)
NS_AllocateContiguousHandleWithData ...
nsSharableString::assign(const nsAString&)
nsPromiseFlatString::nsPromiseFlatString(const nsAString&)
PromiseFlatString(const nsAString&)
GetAtomHashEntry(const nsAString&)
NS_NewAtom(const nsAString&)
nsXMLContentSink::SplitXMLName(const nsAString&, nsIAtom**, ...
nsXMLContentSink::AddAttributes(const nsIParserNode&, ...
nsXMLContentSink::OpenContainer(const nsIParserNode&)
Assignee | ||
Comment 2•23 years ago
|
||
The above is from http://www.mozilla.org/performance/mallocsites20011031.html
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.7 → mozilla0.9.8
Assignee | ||
Comment 3•23 years ago
|
||
I never managed to think of a good approach to fixing this, given our hashtable
interfaces.
Target Milestone: mozilla0.9.8 → Future
Comment 4•21 years ago
|
||
hrmm, is this still a problem, with the work alecf has been doing with atoms? I
have a hashkey that uses nsAString, but it still has to allocate a copy of the
string buffer, because we're not using sharable strings.
Comment 5•21 years ago
|
||
well, I'll bet its still a problem - I think that everywhere that I changed to
permanent atoms had flat strings already.. so those call sites are probably
slightly different, but still applicable...
Updated•18 years ago
|
QA Contact: scc → xpcom
Assignee | ||
Comment 6•18 years ago
|
||
No longer relevant with our new string code.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•