3 ms·
Often though, a better pattern for that is to have your "compute thread" not know anything about the UI - it just sends back packets of result data, or serializ
by ytpete 8y ago
Often though, a better pattern for that is to have your "compute thread" not know anything about the UI - it just sends back packets of result data, or serialized model updates, which the view-model layer back in the "UI thread" uses to rerender.
If React's virtual DOM diffing is epxensive enough to be a bottleneck in some applications though, I could see an advantage to moving that off thread...
- acemarke 8y agoThere's been some experiments with moving React's logic into a web worker, but the main one I know of was a couple years back : http://blog.nparashuram.com/2016/02/using-webworkers-to-make-react-faster.html http://blog.nparashuram.com/2016/02/using-webworkers-to-make... . Would be interesting to try updating that.