Skip to content

How to minimise main-thread work

Speed1 min readFixes check 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.

How to fix it.
  1. Reduce JavaScript first — it dominates this number on almost every site.
  2. Cut style and layout work by simplifying CSS selectors and DOM size.

Filed under Speed & Core Web Vitals. Copy is generated from the same catalogue that scores every report, so what you read here is what the report says.