Is LCP calculated differently on WPT than on Lighthouse?

Recently, I noticed that WPT can give you some useful information about LCP.
It can identify the type of LCP, in my case it was an image LCP, and it also identified that image’s URL.

I optimized this LCP image and that improved LCP score in WBT.
I then ran separate tests on Lighthouse, but on that tool the score decreased after having optimized the LCP image.

Then I ran some WPT tests, with the Lighthouse audit option turned on, and I did notice that the LCP scores that show in the UI did not match the LCP scores from the Lighthouse audit (now included in WPT’s results).

To see these LCP scores differences I opened the WPT JSON result file. Here is an example of such a file before I optimized the LCP image.

As far as I can tell, the LCP score the WPT’s UI displays is located at the following path in the JSON:
data.runs.2.firstView.largestPaints[2].time
and has value:
3334

The corresponding Lighthouse audit score is located at the following path in the JSON:
data.runs.2.firstView.lighthouse.Performance.largest-contentful-paint
and has value:
2800.65

I would like to understand why the LCP scores WPT calculates are different than the LCP scores Lighthouse calculates.

I would like to understand why the LCP scores WPT calculates are different than the LCP scores Lighthouse calculates.

They’re actually treated as two separate tests. WebPageTest runs as usual, and then we run a test using Lighthouse. The Lighthouse tests are also automatically configured to match Lighthouse’s mobile network profile which means you may see different numbers from the WebPageTest runs themselves and the Lighthouse run.

I then ran separate tests on Lighthouse, but on that tool the score decreased after having optimized the LCP image.

Testing across different tools (or in this case, different settings and/or approaches to network throttling) is always super tricky from a comparison standpoint. My recommendation here is to compare your WPT results to the post-optimization WPT results. The “Plot Full Results” page in particular would be a helpful comparison to help you spot any variance. https://wpt-compare.app/ can help you quickly generate a comparison link for the two tests.

If you want to compare LH results as well, I’d again stick to comparing LH via WebPageTest before and after.

1 Like