Bug 20827

Summary: the 'typeof' operator is slow
Product: WebKit Reporter: Cameron Zwarich (cpst) <zwarich>
Component: JavaScriptCoreAssignee: Cameron Zwarich (cpst) <zwarich>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 20813    
Attachments:
Description Flags
Proposed patch
none
Proposed patch with ChangeLog
none
Proposed patch with ChangeLog mjs: review+

Cameron Zwarich (cpst)
Reported 2008-09-13 02:40:43 PDT
The 'typeof' operator now accounts for about 4.7% of the Shark profile of the V8 Earley-Boyer benchmark. We should look at optimizing it, probably taking advantage of StructureIDs. A lot of the examples in Earley-Boyer are of the form typeof <expression> == <string> We can optimize these using a peephole optimization in CodeGenerator and some new opcodes. I'll assign this to myself.
Attachments
Proposed patch (15.23 KB, patch)
2008-09-14 01:26 PDT, Cameron Zwarich (cpst)
no flags
Proposed patch with ChangeLog (1.86 KB, patch)
2008-09-14 16:24 PDT, Cameron Zwarich (cpst)
no flags
Proposed patch with ChangeLog (16.70 KB, patch)
2008-09-14 16:26 PDT, Cameron Zwarich (cpst)
mjs: review+
Cameron Zwarich (cpst)
Comment 1 2008-09-14 01:26:55 PDT
Created attachment 23407 [details] Proposed patch This patch is a 6% speedup on Earley-Boyer, but it unfortunately triggers the Richards compilation-related badness on my machine. I will try again soon.
Cameron Zwarich (cpst)
Comment 2 2008-09-14 16:24:30 PDT
Created attachment 23423 [details] Proposed patch with ChangeLog
Cameron Zwarich (cpst)
Comment 3 2008-09-14 16:25:06 PDT
Comment on attachment 23423 [details] Proposed patch with ChangeLog Oops, I posted the wrong typeof patch.
Cameron Zwarich (cpst)
Comment 4 2008-09-14 16:26:06 PDT
Created attachment 23424 [details] Proposed patch with ChangeLog
Maciej Stachowiak
Comment 5 2008-09-14 16:58:09 PDT
Comment on attachment 23424 [details] Proposed patch with ChangeLog r=me subject to comments from IRC.
Cameron Zwarich (cpst)
Comment 6 2008-09-14 17:26:43 PDT
Landed with requested changes in r36412.
Note You need to log in before you can comment on or make changes to this bug.