Bug 90174 - Optimize Dromaeo/dom-attr.html by speeding up Element::getAttribute()
Summary: Optimize Dromaeo/dom-attr.html by speeding up Element::getAttribute()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-28 06:48 PDT by Kentaro Hara
Modified: 2012-06-28 10:07 PDT (History)
4 users (show)

See Also:


Attachments
Patch (10.44 KB, patch)
2012-06-28 06:57 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff
Patch (10.70 KB, patch)
2012-06-28 07:00 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.