Bug 113446

Summary: cache parsed interfaces in CodeGenerator.pm
Product: WebKit Reporter: arno. <a.renevier>
Component: WebCore JavaScriptAssignee: arno. <a.renevier>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ggaren, haraken, japhet, oliver, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
script used to benchmark binding generations
none
patch proposal none

Description arno. 2013-03-27 14:52:37 PDT
Hi,
when generating a javascript binding for an interface, it is sometimes necessary to parse some another interfaces, namely its parents interfaces.
Informations about the parents bindings may be needed multiple times. So we end end parsing several times the same interface. But caching the parsing result, we could speedup binding generations.
Comment 1 Kentaro Hara 2013-03-27 14:55:45 PDT
Sounds reasonable.

Did you observe any performance issue caused by the redundant parsing? (I'm just curious about it because parent chains wouldn't be long in most cases.)
Comment 2 arno. 2013-03-27 15:31:49 PDT
Created attachment 195414 [details]
script used to benchmark binding generations

(In reply to comment #1)
> Sounds reasonable.
> 
> Did you observe any performance issue caused by the redundant parsing? (I'm just curious about it because parent chains wouldn't be long in most cases.)


I definitively see an improvement by caching the results.
I used the attached script, launched from WebKitBuild/Release/ to benchmark generate-bindings.pl

When running it on all the WebCore idls, it take me 
3'40" for JavascriptCore and about 13' for V8
With caching, it takes me about 2'10" for both.

(I ran the tests several times to avoid cold cache bias)
Comment 3 Kentaro Hara 2013-03-27 15:32:33 PDT
Great!
Comment 4 arno. 2013-03-27 15:35:57 PDT
Created attachment 195416 [details]
patch proposal
Comment 5 Kentaro Hara 2013-03-27 15:53:32 PDT
Comment on attachment 195416 [details]
patch proposal

Looks good. Feel free to set r?.
Comment 6 Kentaro Hara 2013-03-27 15:55:31 PDT
Comment on attachment 195416 [details]
patch proposal

Thanks!
Comment 7 WebKit Review Bot 2013-03-27 17:37:38 PDT
Comment on attachment 195416 [details]
patch proposal

Clearing flags on attachment: 195416

Committed r147037: <http://trac.webkit.org/changeset/147037>
Comment 8 WebKit Review Bot 2013-03-27 17:37:41 PDT
All reviewed patches have been landed.  Closing bug.