Skip to content

Main-thread work

The main thread is where the browser does most of the work for a page: reading the HTML, applying the styles, working out the layout, drawing the screen, running scripts and cleaning up memory it no longer needs. It can do only one of these at a time. Main-thread work shows how much time the browser spent on each during Google’s lab test.

As long as the main thread is busy, the page can’t react. A tap on the menu waits, and new content isn’t drawn. The total shows how much work the page asks of the browser; the breakdown shows what kind of work it is, which points to the cause.

The categories in the breakdown:

  • Script evaluation: running JavaScript, often the largest part.
  • Style and layout: applying the stylesheets and working out where everything goes.
  • Rendering: drawing the page on the screen.
  • Parsing HTML and CSS: reading the page and its stylesheets.
  • Script parsing and compilation: preparing JavaScript to run.
  • Garbage collection: freeing memory the page no longer uses.

The total isn’t the same as Total Blocking Time. Main-thread work counts all the work; Total Blocking Time counts only the part of long tasks that keeps the page from reacting.

WordPress: The most common cause of heavy main-thread work on WordPress sites is JavaScript from themes, page builders and plugins, which shows up as script evaluation. Page builders also tend to wrap content in many layers of HTML, and a page with thousands of elements makes style, layout and rendering work grow.

Browser: Scripts from other services, such as analytics, ads, chat widgets and embedded videos, add their own script work. Large, complex stylesheets and animations that change the layout repeatedly add to style and layout. The simulated phone has a slower processor, so all of this takes longer in the mobile test.

Permo shows main-thread work in two places on its PageSpeed page. The Main thread card lists each category as a row and as a segment of a ring. Above the waterfall, a strip shows when the main thread was busy during the load; tall blocks are tasks longer than 50 milliseconds, the ones that make the page slow to react.

Lighthouse flags pages that keep the main thread busy for longer than 4 seconds during the load (source: Chrome for Developers, Minimize main thread work, accessed October 16, 2026).

Sources