I want to believe. SVG as an image format.I’ve been busy at my day job not launching code, but over the weekend I had some fun converting kthoom‘s unzip/inflate algorithm from using binary strings to using Typed Arrays. Typed Arrays mean native binary data that is accessible to JavaScript in the browser, making operations like unzip much much faster (like 4x).

Unfortunately browser support is limited to WebKit nightlies (Chromium 11) and Firefox 4 at this time. To compound this, Firefox did not bother to implement FileReader.readAsArrayBuffer() which means you can’t use the File API to read in binary data yet… uh… WTF? So basically I no longer support Firefox in kthoom. Oh well, the performance benefits cannot be ignored and they’ll eventually get there. Bug.

That’s not to say WebKit is all peachy-keen. You currently can crash Chromium OSX nightlies by creating an ArrayBuffer of unusual size and there are some issues passing ArrayBuffers into web workers. This means that I disabled use of Workers in kthoom as a result and everything happens in a single thread. :-/

Oh, and you can’t easily convert bytes from TypedArrays into strings


§1005 · February 23, 2011 · Firefox, Google, Software, Technology, Web · · [Print]

Comments are closed.