An introduction to web workers
JavaScript is a single-threaded language, meaning that it doesn’t natively have a way to spawn processes in separate threads. This makes web browsers run the JavaScript in a web page on the same thread as other processes, which directly affects the performance of the page, most notably, the rendering process,that is in charge of presenting the page on the screen. Bowsers make a considerable effort to optimize the performance of all these moving parts to make a page responsive, performant, fast, and efficient. However, there are tasks that a web application must do in JavaScript that are heavy and potentially “render-blocking”. This means that the browser will have to pay attention to the results of the code and use all the resources to complete the running function before it can focus on the rendering (presenting the page to the screen). If you ever find a process on a web page that makes the site seem “unresponsive”...