[Webkit-unassigned] [Bug 126286] New: Poor Accessor Property Performance

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 30 01:46:36 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=126286

           Summary: Poor Accessor Property Performance
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
               URL: http://jsperf.com/data-vs-accessor-vs-getter-setter/2
        OS/Version: Mac OS X 10.9
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: lists at scratchdisk.com


JavaScriptCore has great performance for data property access (more than twice the speed of V8 at the moment), but unfortunately it doesn't appear to optimize accessor properties at all.

In the linked performance test, I compare various methods of storing and accessing a value on an object:

- data properties
- accessor properties on the object itself
- accessor properties on the object's prototype
- getter / setter functions

Since accessor properties are backed by getter / setter functions, I would expect their use to be equally fast to these function calls.

But in my tests, reading from an accessor property is about 23 times slower than reading from a plain data property, and 10 times slower than a getter function call. I don't expect it to be as fast as data properties, but the factor 10 difference to getters seems extreme.

In comparison, SpiderMonkey is able to execute reading from data properties, accessor properties on the object's prototype and getter functions with the same speed, (all faster than JavaScriptCore's data property access). It looks like the SpiderMonkey's optimizer is able to fully inline the code, which is impressive. Only accessor properties on the object itself are very slow there, probably a bug.

V8 doesn't appear to be as fast in general data property access, but doesn't slow down nearly as much between the different tested methods, resulting in its accessors being almost 8 times faster than JavaScriptCore's.

We are using accessor properties quite widely in the Paper.js library <http://paperjs.org/> and are hoping that the performance of accessors will increase in WebKit / JavaScriptCore

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list