Closed
Bug 822695
Opened 12 years ago
Closed 12 years ago
Use nsCOMArray
Categories
(Toolkit :: Telemetry, defect)
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: espindola, Assigned: espindola)
Details
Attachments
(2 files)
3.47 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
1.78 KB,
patch
|
Details | Diff | Splinter Review |
I had discussed array containers for nsCOM objects just before writing this code, but somehow managed to still use std::vector.
Using nsCOMArray is fairly ugly, but does seem to be the best we have so far. With this change the text size of Telemetry.o goes from 84042 bytes to 83018 bytes.
https://tbpl.mozilla.org/?tree=Try&rev=f05b3a1e1f2d
Attachment #693447 -
Flags: review?(ehsan)
Comment 1•12 years ago
|
||
Comment on attachment 693447 [details] [diff] [review]
do it
Review of attachment 693447 [details] [diff] [review]:
-----------------------------------------------------------------
Please use nsTArray<nsCOMPtr<...>> instead. r=me with that. (I don't think that you need to change any other part of the patch, but make sure that it builds ;-)
Attachment #693447 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 2•12 years ago
|
||
> Please use nsTArray<nsCOMPtr<...>> instead. r=me with that. (I don't think
> that you need to change any other part of the patch, but make sure that it
> builds ;-)
It doesn't, why were you expecting two array implementations to have similar APIs? :-)
So, for size at least nsTArray is the worse:
std::vector: 84201 bytes
nsCOMPtr: 83177
nsTArray: 84399
Are you sure you want me to switch?
Assignee | ||
Comment 3•12 years ago
|
||
As noted on the previous comment, this is the worst one for code size :-(
Comment 4•12 years ago
|
||
(In reply to comment #2)
> > Please use nsTArray<nsCOMPtr<...>> instead. r=me with that. (I don't think
> > that you need to change any other part of the patch, but make sure that it
> > builds ;-)
>
> It doesn't, why were you expecting two array implementations to have similar
> APIs? :-)
>
> So, for size at least nsTArray is the worse:
>
> std::vector: 84201 bytes
> nsCOMPtr: 83177
> nsTArray: 84399
>
> Are you sure you want me to switch?
Did you happen to investigate why that is? Is that because of more templated code?
Assignee | ||
Comment 5•12 years ago
|
||
> > std::vector: 84201 bytes
> > nsCOMPtr: 83177
> > nsTArray: 84399
> >
> > Are you sure you want me to switch?
>
> Did you happen to investigate why that is? Is that because of more
> templated code?
I have not looked at it, sorry. There is probably some interesting missing optimization in nsTArray, but I could not find time to figure it out.
Comment 6•12 years ago
|
||
(In reply to comment #5)
> > > std::vector: 84201 bytes
> > > nsCOMPtr: 83177
> > > nsTArray: 84399
> > >
> > > Are you sure you want me to switch?
> >
> > Did you happen to investigate why that is? Is that because of more
> > templated code?
>
> I have not looked at it, sorry. There is probably some interesting missing
> optimization in nsTArray, but I could not find time to figure it out.
OK, you can go ahead with the original patch then, this is not important enough to waste too much time on it...
Assignee | ||
Comment 7•12 years ago
|
||
Comment 8•12 years ago
|
||
(In reply to Rafael Ávila de Espíndola (:espindola) from comment #2)
> > Please use nsTArray<nsCOMPtr<...>> instead. r=me with that. (I don't
> > think that you need to change any other part of the patch, but make sure
> > that it builds ;-)
>
> It doesn't, why were you expecting two array implementations to have similar
> APIs? :-)
That's bug 493711, waiting for review from sicking.
Comment 9•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in
before you can comment on or make changes to this bug.
Description
•