W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2009

[whatwg] Canvas pixel manipulation and performance

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sun, 29 Nov 2009 00:47:18 -0500
Message-ID: <4B120AE6.5020203@mit.edu>
On 11/29/09 12:15 AM, Kenneth Russell wrote:
>> I assume you meant JS bitwise operators?  Do we have any indication that
>> this would be faster than four array property sets?  The bitwise ops in JS
>> are not necessarily particulary fast.
>
> Yes, that's what I meant. I don't have any data on whether this would
> currently be faster than the four separate byte stores.

Are they even byte stores, necessarily?  I know in Gecko imagedata is 
just a JS array at the moment; it stores each of R,G,B,A as a JS Number 
(with the usual "if it's an integer store as an integer" optimization 
arrays do).  That might well change in the future, and I hope it does, 
but that's the current code.

I can't speak to what the behavior is in Webkit, and in particular 
whether it's even the same when using V8 vs Nitro.

-Boris
Received on Saturday, 28 November 2009 21:47:18 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:19 UTC