Unless your object is already in binary buffer format, there is not performance benefit in converting it into that format and back. For some reason, this is something most Web Socket users fail to grasp – questions like this are asked all the time. My answer is always the same – if your concern is performance, do not convert anything:
- https://stackoverflow.com/a/33673378/607407
- https://stackoverflow.com/a/34061491/607407
Just use plain good ol’:
worker.postMessage(myArray);
If you for some reason think I’m wrong about the performance, feel free to fact-check my claims using interactive snippet in this answer:
- https://stackoverflow.com/a/33309300/607407
5
solved Posting Three.js meshes to web worker using javascript