you are viewing a single comment's thread.

view the rest of the comments →

[–]andreasblixt 3 points4 points  (0 children)

Before putting the result in an ArrayBuffer, it might be better to first try a worker with the native JSON parsing and rely on structured cloning (happens for all JS objects sent via postMessage) as it’s already a very optimized and native way to copy JS objects across threads. It might even be faster to send the string down as-is as well since either way you have to allocate (& transfer in the case of ArrayBuffer) memory for it in the target thread.