Closed
Bug 122438
Opened 23 years ago
Closed 23 years ago
ConvertContractIDKeyToString(...) optimization.
Categories
(Core :: XPCOM, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla0.9.9
People
(Reporter: dougt, Assigned: neeti)
Details
(Keywords: perf)
Attachments
(4 files)
1.54 KB,
patch
|
Details | Diff | Splinter Review | |
1.80 KB,
patch
|
Details | Diff | Splinter Review | |
3.28 KB,
patch
|
dougt
:
review+
|
Details | Diff | Splinter Review |
3.29 KB,
patch
|
alecf
:
superreview+
|
Details | Diff | Splinter Review |
Why does ConvertContractIDKeyToString(...) in nsComponentManager.cpp create
an intermediate 'nCAutoString' ??
+ const char *contractID = entry->mContractID;
+ nsCAutoString converted;
+
+ converted.Append(contractID);
+
+ wrapper->SetData(converted.get());
It looks like we should be able to do the following:
wrapper->SetData(entry->mContractID);
In general, ConvertFactoryEntryToCID(...) and ConvertContractIDKeyToString(...)
are incredibly inefficient !!! Since they are called as enumerator functions we
might want to optimize them a bit ;-) At the very least it seems like calling
do_CreateInstance() is a bit of a waste since the code is INSIDE OF THE
COMPONENT MANAGER !! I'm sure there is a faster way to create components ;-)
Reporter | ||
Comment 1•23 years ago
|
||
Neeti, please look at this when you have have a chance.
Assignee: dougt → neeti
Target Milestone: --- → mozilla0.9.9
Reporter | ||
Comment 4•23 years ago
|
||
Comment on attachment 68547 [details] [diff] [review]
patch for optimization
why are you going through the nsComponentManager static class? Cant you just
use the global that should be available since you are in the
nsComponentManagerImpl.
Attachment #68547 -
Flags: needs-work+
Reporter | ||
Updated•23 years ago
|
Attachment #68608 -
Flags: needs-work+
Reporter | ||
Comment 6•23 years ago
|
||
Comment on attachment 68608 [details] [diff] [review]
revised patch using global componentManager
just pass the "this" pointer into the "data" closure.
Updated•23 years ago
|
Reporter | ||
Comment 8•23 years ago
|
||
Comment on attachment 69090 [details] [diff] [review]
revised patch
make sure this compiles xp. (I am worried that you didn't need to cast
|this|).
Also, I believe that reinterpret cast is the wrong thing.... you want a static
cast... but I am not totally sure on that.
Other than that, r=dougt.
Attachment #69090 -
Flags: review+
Comment 10•23 years ago
|
||
Comment on attachment 69264 [details] [diff] [review]
revised patch casting "this", and using NS_STATIC_CAST
sr=alecf
Attachment #69264 -
Flags: superreview+
Assignee | ||
Comment 11•23 years ago
|
||
fix checked in
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•