3 ms·
Message passing without shared memory is slow, having to copy data and maybe even serialise/deserialise it in the process. Message passing where you are just pa
by samwillis 5y ago
Message passing without shared memory is slow, having to copy data and maybe even serialise/deserialise it in the process. Message passing where you are just passing a pointer is fast.
Web workers are basically the worst case, you have to serialise your data to and from JSON when passing it to and from a worker. It’s not built for performance. There have been many cases where people have tried to improve performance of their apps by offloading work to a web worker but the added cost of serialisation ultimately made it slower than running on the main thread.