October 4, 2012
Transferable objects for FF

A short introduction: if you want to send data to/from a Web Worker, you have to use postMessage() method. Internally what happens is that the data is duplicated using the structured cloned algorithm and then the copy is sent.

To make this sharing faster, HTML5 specs add a new concept: transferable objects, data is transferred from one context to another without copy. Note: data is no longer available once transferred to the new context. Right now we can transfer just ArrayBuffers, but maybe in the future we will support other data types.

I wrote this patch (Bug 720083) and it will be available in the nightly build soon. Here a demo/benchmark app: demo. Here another one: demo2.

Have fun!

  1. 143th posted this