Skip to content

Troubleshooting guide

How to reduce Total Blocking Time (TBT)

TBT adds up how long the main thread was too busy to respond during page load. It predicts how responsive your page will feel.

3 min read10 sectionsUpdated

On this page

Key points

  • Every task beyond 50 ms counts its excess.
  • TBT is a lab metric; INP is the field equivalent.
  • JavaScript execution dominates on mobile.
  • Yielding makes long work interruptible.

What TBT measures

Between First Contentful Paint and Time to Interactive, each task longer than 50 ms adds its time above 50 ms to TBT. A 250 ms task adds 200 ms. Good is 200 ms or less on a mid-range mobile profile. It correlates well with INP, which is the real-user metric Google actually uses.

What causes it

  • Large JavaScript bundles to parse, compile and run.
  • Hydration of a big page all at once.
  • Third-party scripts: chat widgets, tag managers, ads.
  • Expensive layout work from large DOMs.

Find long tasks

In Chrome DevTools, record the Performance panel with 4x CPU slowdown, and look for red-flagged tasks. In the field, the Long Tasks and Long Animation Frames APIs report them.

bash
// Log long tasks in the page
new PerformanceObserver((list) => {
  for (const e of list.getEntries()) console.log(Math.round(e.duration), e.name, e.attribution?.[0]?.containerSrc);
}).observe({ type: 'longtask', buffered: true });

# Lab TBT from the command line
npx lighthouse https://example.com --only-audits=total-blocking-time,mainthread-work-breakdown,bootup-time --quiet --output=json | python3 -c "import sys,json; print(json.load(sys.stdin)['audits']['total-blocking-time']['displayValue'])"

Fixes

Remove what you do not need, following reduce JavaScript bundle size. Code-split by route. Hydrate less: use server components or partial hydration. Break up long work by yielding with scheduler.yield() or setTimeout. Move calculations to a Web Worker. Load third-party widgets on interaction, or after the page is idle, and consider a facade for heavy embeds such as chat or video.

Why phones suffer more

The same JavaScript can take four or five times as long on a mid-range Android phone as on a developer's laptop, and a large share of the web's visitors use devices like that. That is why tests use CPU throttling. Download size is only part of the cost: a 500 KB bundle costs more than a 500 KB image, since it must also be parsed, compiled and run. If you have only checked on a fast machine, throttle the CPU in DevTools, and you will probably see a very different page.

Catch it automatically

Run a lab check in CI against a budget, and follow INP and long tasks with real-user monitoring. Check INP tests a single page.

Frequently asked questions

What is a good TBT?

200 ms or less in a mobile lab test.

Does TBT affect rankings?

Not directly. INP is the ranking-related metric, and TBT helps predict it.

Will a Web Worker always help?

Only for work that does not need the DOM.

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.