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...
Created attachment 59576 [details] [diff] [review] Allocate nsAutoString, and speed up NS_NewHTMLReflowCommand a bit...
Taking bug. Reviews?
Assignee: dbaron → jst
Whiteboard: [HAVE FIX]
Target Milestone: --- → mozilla0.9.7
17 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
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
Last Resolved: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.