

Javascript jpeg encoding - geuis
http://ajaxian.com/archives/javascript-jpeg-encoding

======
sosuke
The original blog post is not responding, presumably due to traffic, so I am
going off the screenshot provided by Ajaxian. The quotes from Ajaxian say that
the original author suggested that the V8 and Nitro engines were faster at
doing JPEG encoding than the AS3 VM. The times given in the screenshot list
703ms and 504ms which I take as the same test with 2 different results. Using
the size of the image from the screenshot as 200x255 image I used a AS3 code
test, made in Flex, that compares different encoding libraries speed in AS3.
The slowest of these libraries encoded a same size JPEG in 270ms and the
fastest at 16ms. This test only shows that the JPGEncoder class from the
as3corelib library is slower than his JavaScript implementation, not that the
AS3 VM is slower than Nitro or V8.

Without the blog site being up I can't do any further testing though to use
identical JPG source images but I do take notice when one engine is claimed
faster than another. JavaScript and ActionScript are very similar so I suspect
most of these libraries, other than the C/C++ based ones, can be ported to
JavaScript as he mentioned doing based off the as3corelib implementation,
JPGEncoder.

You can see the source I used to compare AS3 JPEG encoding libraries here
<http://segfaultlabs.com/blog/post/asynchronous-jpeg-encoding>

Edit: He said that the Nitro and V8 engines were faster but his test proved
otherwise. His conclusion was that it was only slower because JavaScript has
no static types, vectors, byte-arrays and is not pre-compiled.

Additional Edit: Cool! JPEG encoding in JavaScript :)

