RESOLVED FIXED Bug 92557
[V8] TypedArray binding performance improvements
https://bugs.webkit.org/show_bug.cgi?id=92557
Summary [V8] TypedArray binding performance improvements
arno.
Reported 2012-07-27 15:41:45 PDT
Hi, #90838, #92518 and #92556 improve TypedArray performances in JavaScriptCore. This bug is to implement those improvements in v8.
Attachments
patch proposal (11.85 KB, patch)
2012-07-31 10:41 PDT, arno.
no flags
updated patch (11.99 KB, patch)
2012-07-31 11:40 PDT, arno.
no flags
updated patch to address review (14.82 KB, patch)
2012-07-31 15:38 PDT, arno.
no flags
updated patch (14.81 KB, patch)
2012-08-01 15:51 PDT, arno.
no flags
arno.
Comment 1 2012-07-31 10:41:44 PDT
Created attachment 155583 [details] patch proposal It appears some of the optimisations made in bug #90838 and bug #92556 are not interesting. Actually, iterating over the c++ array elements to set the value is slower than the current copyElements method (about two times slower). We can still improve performances by using memcpy if the array we construct from is the same type. Also, we can benefit from creating arrays with createUninitialized. With this patch, Bindings/typed-array-construct-from-typed.html time goes from 600ms to around 550ms, and Bindings/typed-array-construct-from-same-type.html goes from 400ms to 55ms
arno.
Comment 2 2012-07-31 11:40:58 PDT
Created attachment 155595 [details] updated patch
Kenneth Russell
Comment 3 2012-07-31 11:53:10 PDT
Comment on attachment 155595 [details] updated patch View in context: https://bugs.webkit.org/attachment.cgi?id=155595&action=review Thanks for the patch. It looks good overall, but r- because of one needed null check. Also one comment about sharing code. > Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h:142 > + RefPtr<ArrayClass> array = ArrayClass::createUninitialized(length); Even though currently this will never return 0 (Chrome will crash before failing a call to malloc), please do the same null check as below. Also please share the error string. > Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h:150 > + return args.Holder(); It would be really nice if this block of code weren't duplicated.
arno.
Comment 4 2012-07-31 15:38:18 PDT
Created attachment 155650 [details] updated patch to address review
Kenneth Russell
Comment 5 2012-08-01 14:42:07 PDT
Comment on attachment 155650 [details] updated patch to address review View in context: https://bugs.webkit.org/attachment.cgi?id=155650&action=review Thanks, this looks almost perfect. One issue which is confusing, therefore the r-. If you can clean this up I'll r+ the next version. > Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h:48 > +v8::Handle<v8::Value> wrapWebGLArrayBuffer(const v8::Arguments& args, WrapperTypeInfo* type, ArrayClass array, v8::ExternalArrayType arrayType, bool hasIndexer) This is a misleading name. It has nothing to do with ArrayBuffers. Please call it "wrapTypedArray" or "wrapArrayBufferView". (The use of "WebGL" throughout this file is historical and is something that should be cleaned up in a separate patch.)
arno.
Comment 6 2012-08-01 15:51:21 PDT
Created attachment 155908 [details] updated patch
Kenneth Russell
Comment 7 2012-08-01 16:06:50 PDT
Comment on attachment 155908 [details] updated patch Thanks, looks good. r=me
WebKit Review Bot
Comment 8 2012-08-01 16:53:23 PDT
Comment on attachment 155908 [details] updated patch Clearing flags on attachment: 155908 Committed r124386: <http://trac.webkit.org/changeset/124386>
WebKit Review Bot
Comment 9 2012-08-01 16:53:27 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.