How to reduce Total Blocking Time in Lighthouse and find long tasks

Short answer

Run a mobile Lighthouse test, find Total Blocking Time in the report, and record a page load in Chrome DevTools. Find the long tasks on the Main track and identify what each one was running. Change one cause and repeat the same test several times. If a particular tap or key press feels slow, record that action separately and check real-user INP where data is available.

Read the guide

Updated:

Share

Summarize with ChatGPT or Perplexity

How to reduce Total Blocking Time in Lighthouse and find long tasks

Why a visible button can still feel broken

Imagine opening a product page and tapping the filter as soon as you can see it. Nothing moves for a moment. You tap again, then both requests are processed together. The button was visible, but the browser was still getting through its startup work. It takes time to parse JavaScript, initialize the interface and run code added by other services. The browser’s main thread also needs time to handle input, calculate layout and prepare screen updates.

Three waits can contribute to an interaction. First, the browser may finish a task before it starts handling the input. Then the handlers run. Finally, the browser has to draw a frame that reflects the change. A filter may need a network request before it can show results, but you can usually acknowledge the input first. Opening the panel or showing a loading state helps the visitor understand that the tap registered.

Total Blocking Time, or TBT, measures a particular part of that problem in a lab run. A task that runs on the main thread for more than 50 milliseconds is a long task. Only the portion above 50 milliseconds contributes to TBT. Lighthouse starts tracking after First Contentful Paint, the moment the page first draws content, and by default ends at the Time to Interactive boundary. Long tasks later in a visit can still affect people, so investigate the exact interaction when you have a complaint. How TBT is calculated

Here is a simple calculation. Suppose the measured window includes tasks that last 40, 70 and 180 milliseconds. The first contributes zero, the second contributes 20 and the third contributes 130. The total is 150 milliseconds. These are illustrative numbers. Lighthouse performs the calculation for your run. What matters for a person is whether a task overlaps with the moment they try to use the page.

What you observe What to inspect next
High TBT on page load Long tasks after the first content appears.
Low TBT, but a slow menu after a tap A separate Performance recording of the interaction.
TBT improves and field INP stays similar Which user actions remain slow, plus the sample and observation window.
Visitors stare at a blank page The document request and paint metrics. TBT covers a different part of the experience.

The Chrome Dev Summit 2020 talk on this topic uses First Input Delay, or FID, as its field metric. The current Core Web Vitals metric is Interaction to Next Paint, or INP. INP reflects the time from an interaction to the next frame and considers interactions during the visit. A lab trace lets you inspect a reproducible scenario. Field data reflects the devices and actions of actual visitors. Chrome Dev Summit talk · What INP measures

Open Chrome DevTools and locate the TBT value

Choose one URL and write down what the visitor is trying to do. For a store, use the specific product page where the variant selector feels late. A homepage, product page and checkout may run different code. Test the page where you can reproduce the symptom.

  1. Open that URL in Chrome on a computer. A guest profile or an incognito window without enabled extensions keeps extension activity out of the initial test. For an authenticated page, use a test account and run the browser tools locally.
  2. Open Chrome’s three-dot menu and choose More tools → Developer tools. You can also press Ctrl+Shift+I on Windows or Option+Command+I on macOS. The panel usually docks to one side or the bottom.
  3. Find the Lighthouse tab. If it is hidden, open the overflow menu in the DevTools tab bar. Select Navigation, Mobile and Performance, then start the page-load audit. Names may be translated in your browser.
  4. In the report, locate Total Blocking Time under Performance. Write down the value in milliseconds and save the report with the URL and test setup.
  5. For a publicly reachable URL you can also run PageSpeed Insights, choose Mobile, and look for TBT in the diagnostics. Any available field data appears in a separate section. Open Chrome DevTools · Run Lighthouse · PageSpeed Insights

Chrome DevTools open with the Network tab and image filter selected

The first screenshot shows DevTools with Network selected. The Lighthouse and Performance tools are available from the same tab bar. Open the double-arrow overflow menu if the panel is too narrow to show their names.

A real Lighthouse run showing Total Blocking Time of 1,290 milliseconds, LCP of 3.2 seconds, and CLS of 0

The report above is one mobile lab run of the guide on checking site speed. TBT is 1,290 milliseconds, LCP is 3.2 seconds, and CLS is 0. The picture shows where to find the measurement. It takes a Performance recording to determine which tasks drove that result, and one run alone does not describe the experience of all visitors. The page tested in the screenshot

Run the same audit three times, one at a time. Record each value and take the median. For example, the median of 260, 280 and 350 milliseconds is 280. Keep mobile and desktop in separate rows. If the differences between runs are large, check whether they loaded the same consent state, whether logged-in content changed, and whether other software was using the machine. Repeat the series after removing that variable. Keep the same tool and profile after a fix. How PageSpeed Insights collects lab and field data

Use Performance to identify the task

Open the Performance panel in DevTools. For a startup problem, use the record-and-reload control. To check a specific action, start a normal recording, press the button once, wait for the result and stop. In an interaction test, decide when to tap. A tap immediately after the heading appears may overlap with startup work, while another tap on an idle page may behave differently. If you apply CPU throttling to reproduce the problem, keep that profile when verifying the fix.

Find Main, the track for the page’s main thread. Look for a long block at the time of the delay. Chrome marks long tasks with a red indicator or shading in the relevant view. Zoom into the suspicious interval and select a block to inspect its details. Keep the events before the action in view. The task keeping an event handler waiting may be an unrelated calculation that started at page load.

Open Bottom-up for that interval. Self Time shows time spent in the selected activity itself. Total Time also includes work initiated below it in the call stack. Use the call tree when you need to know who started the work. If bundle minification hides the original function names, a source map in a test environment can make the trace readable. A useful handoff to the developer includes the page, device profile, steps to reproduce, time range and file or function you observed. Performance panel reference

The Network panel answers a related question. It tells you how a file reached the browser. A short request may deliver a small analytics script that runs an expensive computation. A JavaScript file already in cache still has to be used by the browser. Look at the network request and the task around the time it finished. When Lighthouse provides a third-party breakdown, use the domain as a clue and verify it against the trace.

Try the same work as one task and as eight chunks

Open the long-task exercise in Chrome. The page can be saved and opened locally. It has no external requests and uses no data from your site. Choose Run one task, wait for “Run recorded,” and select Run eight chunks. Each button performs about 240 ms of synthetic work. One performs all of it in a single browser task. The other performs eight pieces of about 30 ms and yields between pieces.

Chrome exercise results showing 190 ms above the long task threshold before splitting and 0 ms after

Across three Chrome runs here, the single task lasted 240 ms and contributed 190 ms above the 50 ms threshold. The eight chunks took the same amount of active work and produced no observed task above the threshold in the exercise. The time from start to finish is longer with chunks because of the pauses. Those gaps give the browser opportunities to handle input and update the screen. Your timings may vary with the browser and computer load.

Open Performance while the exercise is visible and start a recording with the circle button. Click Run one task, wait for the result, and stop the recording. On the Main track, find the long block next to the click. Select that time range, open Bottom-up, and look for the function named work. Make another recording with Run eight chunks. The work appears across separate tasks. Use that same process on your site to locate the function, script URL, or rendering event associated with the delay.

The exercise uses the Long Tasks API and reports excess time during a short window following the click. Run Lighthouse separately to measure load TBT. Use the exercise to see the mechanism, then accept a real fix based on the page and action people reported as slow.

Fix one cause and repeat the exact test

Suppose a test product page renders a list while startup JavaScript calculates recommendations. A user opens the filter while that calculation is already in progress. Test one change on a copy. Keep the filter available and move recommendation work closer to the moment the visitor reaches that part of the page. Recheck keyboard navigation, the recommendation block, and the filter. You now have an experiment that can show whether that one task was competing with the important action.

If the work is essential, try reducing how much of it happens. For a catalogue, ask whether the filter really needs to process the entire dataset after each tap. When expensive processing still needs to run, break it into chunks and give the main thread time to handle other work between them. A developer can consider scheduler.yield() after checking browser support and a fallback. Marking a function async or waiting on an already resolved promise may leave the browser without a usable gap to render. A Web Worker can handle some independent computation, with interface updates staying on the main thread. Techniques for breaking up long tasks

If the startup bundle causes the long tasks, investigate duplicate dependencies and imports that pull in more modules than you use. A component that visitors reach later may be a candidate for code splitting. In server-rendered applications, measure hydration, when scripts attach interactive behavior to HTML already on the screen. Keep early actions usable as you defer other work. For a chat widget or analytics script, test any timing change on staging and confirm that it respects consent and still records the events the team needs. Inspect unused bytes with Chrome DevTools Coverage

If you manage the site through an editor, start with a change you can undo. Turn off one optional widget on staging through its own settings, record the same scenario, and check the controls that use it. Turn it back on and record again. If the same task disappears and returns with the widget, you have evidence to ask about loading it later or replacing it. Leave checkout, sign-in, and consent features in your live workflow while you test them on a copy. Restore the original setting if a user journey breaks or if the delay you were trying to fix is unchanged.

Where the Mercado Libre case is useful

Mercado Libre looked at product detail pages as a group and reproduced responsiveness issues with a representative device and connection profile. The team used the request waterfall and main thread recording to identify cost in its tracking module and large JavaScript bundle. It removed unneeded work, reduced the code in the main bundle and improved when parts of the interface loaded and hydrated. That sequence makes the case more useful than the headline number. The team could measure changes on one page type and confirm the effect with real-user data.

The published 90% reduction is for the older lab metric Max Potential FID. In the CrUX field results, the share of users in the fast FID category rose from about 82% to more than 91%. The case predates today’s INP metric, and those figures describe stated results for their own pages. The method still transfers. Let field data tell you where to look, narrow the lab scenario and then confirm a real-user change. Mercado Libre case study and charts

What to verify before calling the change finished

Save the original and updated reports with the settings for each run. Repeat the same mobile load test and the actual interaction. In a shop, open filters, apply a choice, select a variant and add an item to the basket. For a lead form, try opening it, correcting a validation error and submitting with test data. Check that the browser gives an observable response when the user acts and leaves them able to finish the task.

Watch field INP after release where a URL or a group of similar pages has enough data. The rolling observation window means the change can take time to become visible there. Use repeatable lab measurements and a working user flow for immediate verification. Keep a reference to the trace and the specific fix so that a later regression can be compared with the result. Find slow interactions in field data · Compare Lighthouse reports before and after a release · Diagnose INP over 200 ms

Next steps: diagnosing a low mobile PageSpeed score and diagnosing mobile speed on WordPress.

← Back to blog

Need help with your website?

Development and SEO services →

Related articles