Unfortunately, things don’t seem to be getting better. In the context of online user experience, this translates to rage-clicking buttons, low-quality animations, and laggy scrolling.Īny way you slice it, the Main Thread is overworked and underpaid: Some people have compared this behavior to the 9am rush hour traffic, where everything drives on one road (the Main Thread).Īnd when the main road (thread) is blocked, people have a bad time. JavaScript is an extremely expensive resource, and usually, it’s the main villain when it comes to Main Thread blocking.īy default, all JavaScript runs on the Main Thread. That’s why minimizing Main Thread work lets the browser, paint pixels on the screen faster and be more responsive to the user.Īnd in this article, you will learn how to do that. This leads to slow load times, unresponsive pages, and a bad user experience. If we keep the Main Thread blocked, it can’t perform its crucial tasks. The Main Thread is where the browser does most of the work needed to display a page. And all of them are handled by the Main Thread. These are just some of the steps browsers take to turn code into interactive web pages. HTML, CSS, and JavaScript parsing, construction of the Document Object Model (DOM), adding computed styles, producing the layout tree, creating paint records, responding to user interactions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |