How to minimise main-thread work
Parsing, compiling and running JavaScript, plus styling and layout, all happen on one thread. Less script and simpler CSS keep it free for interaction.
Step by step, with screenshots: DOM size: why 3,000 nodes is a problem and how to shrink a page →
Check your own site
Runs this check and the other 186, free, in about 45 seconds.
What a passing site looks like
- Main-thread work: passeswarning · −2 ptseffort L
Main-thread work
Why it matters. This is the total time the browser spent parsing, compiling and running your page's code. While it works, it cannot respond to the visitor.
- Reduce JavaScript first — it dominates this number on almost every site.
- Cut style and layout work by simplifying CSS selectors and DOM size.