LCP in lighthouse vs PerformanceObserver API #15787
-
I am running lighthouse with user flows and am confused about the discrepancy between the values I receive from lighthouse versus the values I receive from the PerformanceObserver API. For example, when I navigate to https://www.vogue.com/, lighthouse reports an LCP of 5.0 s. However, the PerformanceObserver API gives me I know that LCP can be broken down into 4 components with load time being one of them, but when I look at the diagnostics I find the load time for the LCP element is:
Can anyone explain this discrepancy? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Are you aware that by default Lighthouse simulates the metrics as if the test ran on a mobile device and 3G network? https://github.com/GoogleChrome/lighthouse/blob/main/docs/emulation.md |
Beta Was this translation helpful? Give feedback.
There's an audit in the LHR called
metrics
that hasobservedX
metrics, the actual value of the metrics. You could disable emulation, or just read the observed values, to get results that match using Perf observer manually. Of course there could be other differences between LH and a manual inspection, you'd have to present some example LHRs / websites for us to say more.The values for phase breakdown in
largest-contentful-paint-element
will be simulated if emulation is used, otherwise will be observed. Simulation does not change what element is the LCP (but of course, mobile vs desktop runs may differ).@adamraine should we add to
metrics
the observed phase breakdowns?