Bug 61821 - [V8] Optimize fetches of indexed properties in custom bindings
Summary: [V8] Optimize fetches of indexed properties in custom bindings
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kenneth Russell
Depends on:
Reported: 2011-05-31 16:55 PDT by Kenneth Russell
Modified: 2011-06-01 12:56 PDT (History)
4 users (show)

See Also:

Patch (1.89 KB, patch)
2011-05-31 17:03 PDT, Kenneth Russell
no flags Details | Formatted Diff | Diff
Patch (4.92 KB, patch)
2011-06-01 12:49 PDT, Kenneth Russell
japhet: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2011-05-31 16:55:06 PDT
Currently the custom V8 bindings for typed arrays' set() method taking a JavaScript array allocate a new Number instance for each element fetched. The V8 API contains a method on the Object class which supports faster fetching of indexed properties. I'm not sure whether it was an oversight on my part or whether that method didn't exist at the time the code was written, but it should definitely be used.
Comment 1 Kenneth Russell 2011-05-31 16:57:47 PDT
The associated Chromium bug report is http://crbug.com/84007 .
Comment 2 Kenneth Russell 2011-05-31 17:03:36 PDT
Created attachment 95513 [details]
Comment 3 anton muhin 2011-06-01 06:44:50 PDT
Comment on attachment 95513 [details]

Comment 4 Nate Chapin 2011-06-01 08:29:44 PDT
Comment on attachment 95513 [details]

This is fine, though I notice that there are several other places in the v8 bindings where we are still using the the Get() variant you're removing here.  Is there any reason we shouldn't change those too?
Comment 5 Kenneth Russell 2011-06-01 12:05:34 PDT
Good point. I've updated the synopsis and will upload a new patch shortly.
Comment 6 Kenneth Russell 2011-06-01 12:49:40 PDT
Created attachment 95644 [details]
Comment 7 Nate Chapin 2011-06-01 12:50:34 PDT
Comment on attachment 95644 [details]

Great, thanks!
Comment 8 Kenneth Russell 2011-06-01 12:56:51 PDT
"webkit-patch land" hung.

Committed as http://trac.webkit.org/changeset/87837 .