Closed
Bug 106796
Opened 23 years ago
Closed 19 years ago
Improve GetNameSpaceID() performance
Categories
(Core :: XML, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: hjtoi-bugzilla, Assigned: peterv)
References
Details
(Keywords: perf)
Attachments
(1 file)
(deleted),
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
GetNameSpaceID() can get used a fair amount of time in DHTML applications. For
example on Bugzilla query page clicking on a product and moving the mouse a tiny
bit it can get called about 10 times. Just starting up it is called only 3
times, and it won't be called at all during jrgm's page load tests. It would
need to be tested if it gets called a lot with non-interactive DHTML, like
animations. Anyway, this is not a huge win, GetNameSpaceID() takes about 1ms.
From brendan in bug 41983:
can we deCOMtaminate GetNameSpaceID and its descendents, and also wean
them off of nsHashtable and onto PLDHashTable instead? That should save a fair
amount of time.
http://lxr.mozilla.org/mozilla/source/content/base/src/nsNameSpaceManager.cpp#476
http://lxr.mozilla.org/mozilla/source/content/base/src/nsNameSpaceManager.cpp#139
I don't see any reason for infallible methods to return NS_OK directly, and to
return their real result via a reference out param. DeCOMtaminate!
I don't see any reason to subroutine FindNameSpaceID if you can look directly
into a global PLDHashTable with PL_DHashTableOperate(&gURIToIDTable, aURI.get(),
PL_DHASH_LOOKUP), cast the returned entry pointer down to an nsURIToIDEntry*,
and return that entry's mID (or else return kNameSpaceID_Unknown if
PL_DHASH_ENTRY_IS_FREE(entry)). You'll save on malloc overhead elsewhere, too
(when adding to the table).
If I can help with pldhash.h usage, please let me know.
/be
Summary: Improve GetNameSPaceID() performance → Improve GetNameSpaceID() performance
Reporter | ||
Updated•23 years ago
|
Priority: -- → P2
Target Milestone: --- → mozilla0.9.7
Reporter | ||
Comment 1•23 years ago
|
||
It doesn't seem like this would be a big win in any situation, futuring.
Target Milestone: mozilla0.9.7 → Future
Updated•22 years ago
|
QA Contact: petersen → rakeshmishra
Updated•21 years ago
|
QA Contact: rakeshmishra → ashishbhatt
Assignee | ||
Comment 2•19 years ago
|
||
Assignee: hjtoi-bugzilla → peterv
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•19 years ago
|
||
Comment on attachment 194229 [details] [diff] [review]
v1
I've changed NS_INAMESPACEMANAGER_IID in my tree.
Attachment #194229 -
Flags: superreview?(jst)
Attachment #194229 -
Flags: review?(jst)
Comment 4•19 years ago
|
||
Comment on attachment 194229 [details] [diff] [review]
v1
r+sr=jst
Attachment #194229 -
Flags: superreview?(jst)
Attachment #194229 -
Flags: superreview+
Attachment #194229 -
Flags: review?(jst)
Attachment #194229 -
Flags: review+
Assignee | ||
Updated•19 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•19 years ago
|
Target Milestone: Future → mozilla1.9alpha
You need to log in
before you can comment on or make changes to this bug.
Description
•