Bug 105540 - CodeGen: Make [Reflect] use fastGetAttribute and fastHasAttribute
Summary: CodeGen: Make [Reflect] use fastGetAttribute and fastHasAttribute
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Erik Arvidsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-20 08:43 PST by Erik Arvidsson
Modified: 2012-12-20 11:47 PST (History)
6 users (show)

See Also:


Attachments
Patch (4.41 KB, patch)
2012-12-20 08:47 PST, Erik Arvidsson
no flags Details | Formatted Diff | Diff
Patch (17.51 KB, patch)
2012-12-20 09:09 PST, Erik Arvidsson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Arvidsson 2012-12-20 08:43:37 PST
Currently the codegen generates code that use getAttribute and hasAttribute. We can use fastGetAttribute and fastHasAttribute when we use a non SVG animated attribute and not HTML::styleAttr.

Performance results:
				With patch				Master 
Bindings/id-getter	runs/s	518.13	± 2.85%	16.17% Better		446.03	± 7.74%
Dromaeo/dom-attr	runs/s	141.68	± 1.72%	20.81% Better		117.27	± 1.47%
Comment 1 Erik Arvidsson 2012-12-20 08:47:52 PST
Created attachment 180347 [details]
Patch
Comment 2 Erik Arvidsson 2012-12-20 09:09:10 PST
Created attachment 180349 [details]
Patch
Comment 3 Andreas Kling 2012-12-20 09:27:48 PST
Comment on attachment 180349 [details]
Patch

r=me, great idea!

Maybe we could also use getIdAttribute()/getNameAttribute() for id/name to avoid iterating over the attribute list in case the attribute isn't present.
Comment 4 Erik Arvidsson 2012-12-20 09:33:03 PST
(In reply to comment #3)
> (From update of attachment 180349 [details])
> r=me, great idea!
> 
> Maybe we could also use getIdAttribute()/getNameAttribute() for id/name to avoid iterating over the attribute list in case the attribute isn't present.

Good idea. I'll do that next.

I was also considering introducing "fast" versions of the following:

getURLAttribute
getIntegralAttribute
getUnsignedIntegralAttribute

But the benefit might be less obvious since these do a lot of work compared to fastGetAttribute and fastHasAttribute.
Comment 5 WebKit Review Bot 2012-12-20 09:42:44 PST
Comment on attachment 180349 [details]
Patch

Clearing flags on attachment: 180349

Committed r138263: <http://trac.webkit.org/changeset/138263>
Comment 6 WebKit Review Bot 2012-12-20 09:42:47 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Tony Chang 2012-12-20 10:51:03 PST
I think this is causing svg/custom/animate-reference-crash.html to hit an ASSERT on the debug bots:
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#showExpectations=true&tests=svg%2Fcustom%2Fanimate-reference-crash.html
Comment 8 Erik Arvidsson 2012-12-20 11:13:55 PST
https://bugs.webkit.org/show_bug.cgi?id=105555
Comment 9 Eric Seidel (no email) 2012-12-20 11:14:17 PST
Not surprising.  That means that fastAttributeLookupAllowed is doing it's job, and we need to make the generator slightly smarter!
Comment 10 Erik Arvidsson 2012-12-20 11:27:15 PST
(In reply to comment #9)
> Not surprising.  That means that fastAttributeLookupAllowed is doing it's job, and we need to make the generator slightly smarter!

Yup. The codegen only checks the type and className is a special case where the type is DOMString and not SVGAnimatedString. Maybe we should override it in SVGSVGElement.idl to use the correct type?
Comment 11 Erik Arvidsson 2012-12-20 11:47:08 PST
(In reply to comment #10)
> (In reply to comment #9)
> > Not surprising.  That means that fastAttributeLookupAllowed is doing it's job, and we need to make the generator slightly smarter!
> 
> Yup. The codegen only checks the type and className is a special case where the type is DOMString and not SVGAnimatedString. Maybe we should override it in SVGSVGElement.idl to use the correct type?

Actually, SVGStylable.idl does override className. Now I'm not sure why we hit the assert.