Wednesday, November 25th, 2009
Another idea was to use the new web workers to do the heavy lifting in an separate thread, not blocking the gui. This is something flash can't do. So I created a version using a web worker for the encoding.
The API gives you a JPEGEncoder or an alternative JPEGEncoderThreaded. Usage is straightforward:
var myEncoder = new JPEGEncoder([quality])
var JPEGImage = myEncoder.encode(CanvasPixelArray,[quality])
Comparing the different browsers Nitro and V8 are a magnitude faster than TraceMonkey. Firefox 3.6b2 shows some improvements, but it's still a long way. Probably the Mozilla guys should consider adopting Nitro or V8?