Just like with Flash, JavaScript code runs by default on the UI thread, and any expensive JavaScript computation will usually affect the UI responsiveness. As you may know, at 60 fps, you have around 16ms per frame to do what you have to do (computations, rendering and other misc logic). If you exceed that budget, you will alter the frame rate and potentially make your content feel sluggish or worse, unresponsive.
Web Workers are now broadly available in most browsers even on mobile and give you the power of concurrency from within JavaScript. It will allow you to move expensive computations to other threads, to permit best responsive programming, and ideally open the doors in the future to true parallelization in JavaScript. Let’s have a look at the reasons why you may be interested into leveraging Web Workers.
Your new post is loading...