web.dev icon indicating copy to clipboard operation
web.dev copied to clipboard

TBT appears to be incorrect (sum of blocking portions of long tasks is much lower than indicated TBT)

Open bramcou opened this issue 5 years ago • 1 comments

Describe the bug After running (re-installed) Lighthouse (mobile device) in Chrome 87 DevTools the indicated Total Blocking Time is 330ms. According to the documentation, the TBT should be the sum of all blocking portions of long tasks between FCP and TTI. In this example (screenshots below) there are two long tasks, one of which only one is after FCP, it takes 160ms, so 110ms blocking time, not 330ms.

I tried 10 different websites and on none of the websites I got a (somewhat) accurate match between my calculated TBT and the indicated TBT.

Furthermore, two interesting things:

  1. If I run the same websites through PSI (which is on the mobile profile by default according to the footer) the TBT figure is much more accurate in compared to my calculated TBT's. You can't however open the original performance trace in PSI so it's not possible to make your own calculation to compare with the PSI data.
  2. FCP on the lighthouse report is way off from the FCP as indicated in the Performance trace. In the screenshots attached the FCP on the lighthouse report is 1.4 seconds. In the original trace (accessed through the View Original Trace button) the FCP is somewhere around 0.5 seconds.

To Reproduce Steps to reproduce the behavior:

  1. Navigate to any website in Chrome 87, run Lighthouse in DevTools with the Mobile profile
  2. Note the TBT
  3. Click on "View original trace"
  4. Sum the amount of blocking times of long running tasks (sum time of all long running tasks - (50 * number of long running tasks).
  5. Compare the above figure with the indicated TBT.

Expected behavior I'd expect the TBT and the FCP in the Lighthouse report to be the same as they are in the corresponding performance trace.

Screenshots image image

bramcou avatar Dec 26 '20 00:12 bramcou

Placed incorrectly in web.dev Moved to lighthouse repo.

bramcou avatar Dec 26 '20 22:12 bramcou