[whatwg] Canvas pixel manipulation and performance

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