loading...

re: How to process heavy workloads AND animate at 60fps in Vanilla JS, any Framework or React Native: VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Very cool! I've had a quick peek at the source code. Do you exclusively use requestAnimationFrame for the animations? I noticed you also have set...
 

So the animations use requestAnimationFrame - the key thing being to use generators to create imperative for next loops in that case.

The processing stuff uses requestIdleCallback. I polyfill that in a variety of ways.

The problem with other threads is the effort of moving things to and from them, so if the animation was basically a ton of processing that resulted in something simple and small enough to move then it would work. I'm thinking some kind of complex particle simulation or 3d work.

code of conduct - report abuse