Without Web Workers
Complex calculations block the main thread so the animation is laggy, not smooth, or even frozen. The page might become unresponsive.
Let's init a very slooooow loop and compare how the page and animation behaves in both cases.
Complex calculations block the main thread so the animation is laggy, not smooth, or even frozen. The page might become unresponsive.
If we extract all the complex calculations in a worker, the animation stays smooth and the page keeps being responsive.