Bug 15350

Summary: skip extra hash lookup and avoid converting char* to UString for 19% speedup on CK JS array test
Product: WebKit Reporter: Maciej Stachowiak <mjs>
Component: JavaScriptCoreAssignee: Maciej Stachowiak <mjs>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
URL: http://celtickane.com/projects/jsspeed2007.php
Attachments:
Description Flags
patch implementing these two optimizations oliver: review+

Description Maciej Stachowiak 2007-10-02 16:08:22 PDT
The Celtic Kane JavaScript Benchmark "Array" test can be sped up 19% by using the return value from add() to avoid an extra hash lookup for contains(), and by storing some strings in function-scope static UString variables instead of as constant strings used to make new UStrings every time. These issues mainly affect the Array "join" and "toString" operations, which unfortunately seem to make up the vast majority of time on this benchmark.
Comment 1 Maciej Stachowiak 2007-10-02 16:30:12 PDT
Created attachment 16509 [details]
patch implementing these two optimizations
Comment 2 Oliver Hunt 2007-10-02 16:37:17 PDT
Comment on attachment 16509 [details]
patch implementing these two optimizations

ooh, nice and simple