Closed Bug 112473 Opened 23 years ago Closed 23 years ago

Eliminate double allocation in CSSParserImpl::ParseProperty()

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.7

People

(Reporter: jst, Assigned: jst)

Details

(Keywords: perf, Whiteboard: [HAVE FIX])

Attachments

(2 files)

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...
Taking bug. Reviews?
Assignee: dbaron → jst
Keywords: perf
Whiteboard: [HAVE FIX]
Target Milestone: --- → mozilla0.9.7
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
Yeah, me too...
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...
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 :-)
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.

Attachment

General

Created:
Updated:
Size: