I'd just like to add that I recently launched js-coroutines which seeks to split up sorts, stringifies, compression and your own heavy functions over multiple frames using coroutines and requestIdleCallback. It works pretty well for circumstances where worker threads are hard to achieve or just too much work for an edge case.
I'd just like to add that I recently launched js-coroutines which seeks to split up sorts, stringifies, compression and your own heavy functions over multiple frames using coroutines and
requestIdleCallback
. It works pretty well for circumstances where worker threads are hard to achieve or just too much work for an edge case.My article on how that works.
60fps Javascript while you stringify, parse, process, compress and filter 100Mbs of data
Mike Talbot ・ May 25 ・ 9 min read
Pretty neat! 👍
I think the pattern of offloading state computations to background threads is great for highly interactive applications.
In particular, I'm sure many game developers in the Web space will find your library quite useful.