News for hackers. Stuff that matters.
Re:Writing a Non-Blocking JavaScript Quicksort by lancefisher on Wednesday June 10, 2015 @02:45AM (#9690423)
This is a good approach for the times you can't use web workers. It's not just old browsers either. You can't draw to the canvas with a web worker.

Depending on what you're doing, you may want to yield after x operations rather than on every recursive invocation like the example shown. There is a performance cost to using setImmediate.

Re:Writing a Non-Blocking JavaScript Quicksort by yoklov on Wednesday June 10, 2015 @09:56AM (#9692169)
It's massively unfortunate that a tradeoff like this has to be made (speed vs responsiveness).

But FWIW, you can do canvas pixel operations with a web worker, which you then blit to the canvas, which is acceptable in some cases.