DEV Community

Discussion on: Javascript long-running tasks - Use CPU's idle periods

Collapse
 
canastro profile image
Ricardo Canastro • Edited

Indeed webworkers are good solution for most of use-cases and I have used them way more often then this approach.

I haven't yet benchmark it yet (I hope I have time to do it), but passing data to the webworker and back adds some overhead. Depending on the type and amount of data that overhead might take a toll in time to execute and memory usage.