Closed
Bug 444779
Opened 16 years ago
Closed 16 years ago
Make XPC_XOW_ClassNeedsXOW faster
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: mrbkap, Assigned: mrbkap)
Details
(Keywords: perf)
Attachments
(1 file, 2 obsolete files)
977 bytes,
patch
|
jorendorff
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
In bug 407216 comment 33, jorendorff noticed that XPC_XOW_ClassNeedsXOW took a non-trivial percent of time (showing up in profiles, even). In his words, this is "silly." We should fix it. I have a patch that *should* make things better. Jorendorff said he'd test it, but I'd like to have a bug to hold the patch in.
Assignee | ||
Comment 1•16 years ago
|
||
This should bring us down from 4 calls to strncmp to at most 2 per call.
Attachment #329094 -
Flags: review?(jorendorff)
Comment 2•16 years ago
|
||
Comment on attachment 329094 [details] [diff] [review] Possible fix + switch (*name++) { Doing this increment inside the cases below would save you the increment instruction in the case where we miss the cases.
Assignee | ||
Comment 3•16 years ago
|
||
Attachment #329094 -
Attachment is obsolete: true
Attachment #329144 -
Flags: review?(jorendorff)
Attachment #329094 -
Flags: review?(jorendorff)
Assignee | ||
Comment 4•16 years ago
|
||
Sorry for the spam... The last patch had a typo.
Attachment #329144 -
Attachment is obsolete: true
Attachment #329146 -
Flags: review?(jorendorff)
Attachment #329144 -
Flags: review?(jorendorff)
Updated•16 years ago
|
Version: unspecified → Trunk
Comment 5•16 years ago
|
||
Comment on attachment 329146 [details] [diff] [review] With jst's suggestion OK, I Shark-profiled the Hamlet benchmark from bug 407216 with and without this little patch. Without the patch, Firefox is spending 2.4% of its time in this function. With the patch that goes to 0.26%; apparently most names go to the default:, missing strcmp entirely.
Attachment #329146 -
Flags: review?(jorendorff) → review+
Updated•16 years ago
|
Attachment #329146 -
Flags: superreview+
Assignee | ||
Comment 6•16 years ago
|
||
Pushed as http://hg.mozilla.org/index.cgi/mozilla-central/rev/41d5a8915ca2
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•