Closed
Bug 244475
Opened 20 years ago
Closed 20 years ago
string optimization in HTMLContentSink::AddAttributes
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
People
(Reporter: bryner, Assigned: bryner)
Details
(Keywords: perf)
Attachments
(1 file)
1.03 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
Because of the way shared string buffers work, HTMLContentSink::AddAttributes isn't quite optimal in the way it does an atom lookup for attribute names. In particular, calling ToLowerCase on the shared buffer heap-allocates a new (mutable) buffer, then lowercases the string in-place, then the string is copied again (while being converted to UTF-8) into a stack buffer when do_GetAtom is called. In addition to this, dealing with the shared buffer incurs overhead from doing an atomic increment on the buffer reference count (which is silly since we know we'll need a mutable buffer). I have a patch which does the UTF-8 conversion (into a mutable buffer) up-front, which gets rid of the heap allocation, extra string copy, and atomic increment overhead. It seems to give a Tp win of about 1%.
Assignee | ||
Comment 1•20 years ago
|
||
Assignee | ||
Updated•20 years ago
|
Attachment #149181 -
Flags: superreview?(bzbarsky)
Attachment #149181 -
Flags: review?(bzbarsky)
Comment 2•20 years ago
|
||
Comment on attachment 149181 [details] [diff] [review] patch r+sr=bzbarsky; fix nsHTMLFragmentContentSink too, though?
Attachment #149181 -
Flags: superreview?(bzbarsky)
Attachment #149181 -
Flags: superreview+
Attachment #149181 -
Flags: review?(bzbarsky)
Attachment #149181 -
Flags: review+
Assignee | ||
Comment 3•20 years ago
|
||
checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•