Closed Bug 267506 Opened 20 years ago Closed 20 years ago

Reduce string copying from nsGenericHTMLElement::GetHrefURIForAnchors

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bryner, Assigned: bryner)

Details

(Keywords: perf)

Attachments

(1 file)

Since this method only needs a const string containing the attribute value, it
can use the buffer owned by the nsAttrValue and avoid copy plus (usually) malloc
cost.  This shows up fairly high on the profile for frame construction time on
certain pages, like the netscape.com page on the pageload test.  On that page,
without this patch, nsStyleUtil::IsHTMLLink takes 42% of time spent in
nsCSSFrameConstructor::ConstructFrame.  With this patch, it's down to about 15%.
(It looks like it hits this page hard because it has a lot of AREA elements).
Attached patch patchSplinter Review
In addition to what I said above, this also avoids a bit of buffer refcounting
in nsContentUtils::NewURIWithDocumentCharset.
Attachment #164429 - Flags: superreview?(jst)
Attachment #164429 - Flags: review?(jst)
Comment on attachment 164429 [details] [diff] [review]
patch

r+sr=jst
Attachment #164429 - Flags: superreview?(jst)
Attachment #164429 - Flags: superreview+
Attachment #164429 - Flags: review?(jst)
Attachment #164429 - Flags: review+
checked in
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: