Closed
Bug 83624
Opened 24 years ago
Closed 24 years ago
The nsAutoVoidArray constructor clears the memory which is expensive
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
VERIFIED
FIXED
People
(Reporter: bratell, Assigned: kandrot)
References
()
Details
(Keywords: perf, Whiteboard: fix in hand)
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
I quantified the style system after hyatt's landing of the redesigned system and
noticed that 42% of the time in CSSRuleProcessor::RulesMatching and 3% overall
is spent in the nsAutoVoidArray constructor. The reason this is expensive is
because it clears the full array with memset. I don't see the reason for this.
It seems like an awful easy fix to just remove the memset.
All the figures are from the colour table stress case
Reporter | ||
Updated•24 years ago
|
Blocks: 54542
Keywords: mozilla0.9.2,
perf
Assignee | ||
Comment 1•24 years ago
|
||
It does seem kind of weird, because looking at the code, it appears to be
setting none of them to zero (mImpl->mCount is zero by the time ::memset is
called). From what it looks like to me, I would say we could remove that line,
since it currently does nothing.
Status: NEW → ASSIGNED
Reporter | ||
Comment 2•24 years ago
|
||
You are right. So that line is without any meaning at all (yet it showes on
profiles). Do you want a patch? :-)
Assignee | ||
Comment 3•24 years ago
|
||
Sure, if you have a patch, post it and I will r= it. I believe that the tree
will be closed except for crasher bugs for a bit, bit I will check it in when it
does open. Thanks.
Reporter | ||
Comment 4•24 years ago
|
||
Reporter | ||
Comment 5•24 years ago
|
||
I attached the patch. I have run with it for a week without noticing anything
bad.
Whiteboard: fix in hand
Assignee | ||
Comment 6•24 years ago
|
||
r=kandrot. sr=? a=?
Does it look to be any faster with this patch? Did the times drop as predicted?
Just curious.
Comment 7•24 years ago
|
||
sr=waterson
Comment 8•24 years ago
|
||
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
Blocks: 83989
Assignee | ||
Comment 9•24 years ago
|
||
I have checked in the change. Thanks. (though if you have the performance
numbers, please post them to this bug, thanks)
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 10•24 years ago
|
||
The numbers I have is from Quantify in the table stress case.
nsAutoVoidArray::nsAutoVoidArray 30000 calls
Before: F+D 71 ms (1.47% of total time)
After: F+d 1 ms (0.02% of total time)
Comment 11•24 years ago
|
||
Good lord, is that milliseconds? (I'm guessing you meant to write 71us...)
Reporter | ||
Comment 12•24 years ago
|
||
No, Quantify says 70907,32 us (microseconds) 1.47% of Focus.
Then I'm not sure if Quantify is right since the memset is timed rather than
profiled by instruction count.
The After time is 977,86 us.
I'm marking this VERIFIED since the memset is very gone now (code inspection).
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•