Bug 90174

Summary: Optimize Dromaeo/dom-attr.html by speeding up Element::getAttribute()
Product: WebKit Reporter: Kentaro Hara <haraken>
Component: DOMAssignee: Kentaro Hara <haraken>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, darin, rniwa, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Kentaro Hara 2012-06-28 06:48:52 PDT
By changing the type of 'name' of Element::getAttribute(String& name) from String to AtomicString, we can improve the performance of Element::getAttribute(). This optimization is based on the observation that AtomicString(String&) is faster than operatior==(String&, AtomicString&). More detailed explanation will be appeared in ChangeLog.
Comment 1 Kentaro Hara 2012-06-28 06:57:23 PDT
Created attachment 149944 [details]
Patch
Comment 2 Kentaro Hara 2012-06-28 07:00:40 PDT
Created attachment 149945 [details]
Patch
Comment 3 Adam Barth 2012-06-28 08:24:12 PDT
Comment on attachment 149945 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=149945&action=review

> Source/WebCore/dom/Element.h:146
>      const AtomicString& getAttributeNS(const String& namespaceURI, const String& localName) const;

Should we do the same for getAttributeNS?
Comment 4 Kentaro Hara 2012-06-28 08:30:48 PDT
(In reply to comment #3)
> > Source/WebCore/dom/Element.h:146
> >      const AtomicString& getAttributeNS(const String& namespaceURI, const String& localName) const;
> 
> Should we do the same for getAttributeNS?

Let me do it in a follow-up patch. getAttributeNode() would be another place.
Comment 5 WebKit Review Bot 2012-06-28 10:07:22 PDT
Comment on attachment 149945 [details]
Patch

Clearing flags on attachment: 149945

Committed r121439: <http://trac.webkit.org/changeset/121439>
Comment 6 WebKit Review Bot 2012-06-28 10:07:31 PDT
All reviewed patches have been landed.  Closing bug.