Closed
Bug 112473
Opened 24 years ago
Closed 24 years ago
Eliminate double allocation in CSSParserImpl::ParseProperty()
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla0.9.7
People
(Reporter: jst, Assigned: jst)
Details
(Keywords: perf, Whiteboard: [HAVE FIX])
Attachments
(2 files)
|
1.92 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
|
2.20 KB,
patch
|
Details | Diff | Splinter Review |
In CSSParserImpl::ParseProperty() we do:
nsString* str = new nsString(aPropValue);
which will allocate the nsString object, *and* allocate storage for the string.
In stead of allcating a nsString we should allocate a nsAutoString which will
make us allocate only once if aPropValue fits in the internal nsAutoString
buffer, which is the case most of the time.
Patch coming up...
| Assignee | ||
Comment 1•24 years ago
|
||
| Assignee | ||
Comment 2•24 years ago
|
||
Taking bug. Reviews?
| Assignee | ||
Comment 3•24 years ago
|
||
Attachment #59576 -
Flags: review+
Comment on attachment 59576 [details] [diff] [review]
Allocate nsAutoString, and speed up NS_NewHTMLReflowCommand a bit...
r=dbaron, although I wish we weren't bound to nsIUnicharInputStream
| Assignee | ||
Comment 5•24 years ago
|
||
Yeah, me too...
Comment 6•24 years ago
|
||
Comment on attachment 59577 [details] [diff] [review]
More nsAutoString fun...
+ *aInstancePtrResult cmd = new nsHTMLReflowCommand(aTargetFrame, aReflowType,
Does this compile? I don't think you want |cmd| in there...
| Assignee | ||
Comment 7•24 years ago
|
||
Hmm, yeah, loose the |cmd| :-) My build didn't like that either, but I didn't
see my build had stopped before attaching the patch :-)
| Assignee | ||
Comment 8•24 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•