Skip to content

Conversation

@iamakulov
Copy link

Summary

This PR implements the first change discussed in #16539. When real-world FCP and LCP are the same, we assume they originated from the same element (that’s roughly how it works inside Chromium), and we make the simulated LCP also equal the simulated FCP.

This leads to some sites getting better (and hopefully fairer) scores. How many sites are affected, and how better are the scores? See https://observablehq.com/d/f62cde3eb2ec3e76 for a study across ~350 sites.

Related Issues/PRs

#16539

@iamakulov iamakulov requested a review from a team as a code owner November 8, 2025 00:15
@iamakulov iamakulov requested review from connorjclark and removed request for a team November 8, 2025 00:15
@iamakulov iamakulov changed the title Lantern LCP: Compute LCP as FCP when real-world FCP/LCP occur on the same frame core(lantern): compute LCP as FCP when real-world FCP/LCP occur on the same frame Nov 8, 2025
@iamakulov iamakulov changed the title core(lantern): compute LCP as FCP when real-world FCP/LCP occur on the same frame core(lantern): compute LCP as FCP when they occur within the same frame Nov 8, 2025
@iamakulov
Copy link
Author

iamakulov commented Nov 8, 2025

I tried my best to measure the impact across the board, but I ran into one Lighthouse peculiarity that I couldn’t overcome. From the link above:

Can we trust this data?

Yes and no. I did my best collecting the data over a wide range of sites in a stable environment (t3.large), and filtering out sites that might be problematic (have warnings, etc). However, there’s still one peculiarity in Lighthouse traces that I can’t get rid of.

When you run a Lighthouse test from the Lighthouse CLI (as opposed to DevTools), the first paint often end up significantly delayed. For example, here is one site from the dataset (https://platepost.io/wywhcoffee):

DevTools Lighthouse CLI Lighthouse
CleanShot 2025-11-08 at 01 04 09@2x CleanShot 2025-11-08 at 01 02 18 2@2x
(Trace) (Trace)

Despite the site being the same, and the page being renderable after HTML/CSS loads, with CLI Lighthouse, the first paint would often happen 500-1000ms later than I’d expect it to. This happens both with a “cold” browser (a browser that’s re-launched for every Lighthouse test; the default Lighthouse behavior), and with a “warm” one (a single Chrome instance shared among all Lighthouse tests).

This likely skews the test results, making simulated FCP/LCP worse.

Would appreciate some tips if you know what’s causing this / how to solve this! (Pre-warming the browser where you open it ahead of time and load google.com doesn’t seem to help.)

Ah, and, yes, let me know what the next best steps are / how I can help to get this merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant