4 ms·
Depends on the type of large data, but since 2011 there's "Transferable" [1], where objects like ArrayBuffer, MessagePort, and ImageBitmap can be transferred wi
by reginaldo 5y ago
Depends on the type of large data, but since 2011 there's "Transferable" [1], where objects like ArrayBuffer, MessagePort, and ImageBitmap can be transferred with a low overhead [2]. Now, if you're passing large arbitrary object graphs, you're out of luck.
[1] https://developers.google.com/web/updates/2011/12/Transferable-Objects-Lightning-Fast https://developers.google.com/web/updates/2011/12/Transferab...
[2] https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage https://developer.mozilla.org/en-US/docs/Web/API/Worker/post...
- MuffinFlavored 5y agoAny libraries that make this nicer/easier to do instead of rewriting the same thing over and over?
- The_rationalist 5y agohttps://github.com/Bnaya/objectbuffer https://github.com/Bnaya/objectbuffer and comlink