Network & PerformanceBaseline · Newly

Core Web Vitals Mechanics (LCP, INP, CLS)

Mental Model

Core Web Vitals measure three concrete engine milestones at the 75th percentile of real users: LCP (largest viewport element painted, ≤ 2.5 s), INP (worst interaction from input to next painted frame, ≤ 200 ms), and CLS (unexpected layout shift bursts, ≤ 0.1).

Interactive Simulator

INP Budget: Input Delay + Handler + Presentation

Adjust main-thread blocking task duration and DOM mutation size to see if INP stays under the 200ms Good threshold.

Parameter Profile
inputDelayMs30
handlerDurationMs45
yieldBeforeRenderOn
inputDelayMs
30
handlerDurationMs
45
yieldBeforeRender
On
Parameters evaluated in real time.

Under the Hood

Treating Core Web Vitals as a single Lighthouse score is like diagnosing an engine knock by staring at the odometer. Each metric hooks into a distinct stage of the Browser Rendering Pipeline and Event Loop:

  • LCP splits into four sub-parts: TTFB, resource load delay, resource load duration, and element render delay.
  • INP sums three phases per interaction: Input Delay (waiting for an in-flight task) + Processing Time (event handlers) + Presentation Delay (Style, Layout, Paint, Composite).
  • CLS accumulates impactFraction * distanceFraction across 5-second session windows with a 1-second gap, excluding shifts within 500 ms of user input.
JS
// Break up heavy post-click work so the next frame paints under 200ms INP
button.addEventListener('click', async () => {
  updateButtonStateImmediately();
  await scheduler.yield?.() ?? new Promise((r) => setTimeout(r, 0));
  runExpensiveAnalyticsAndSync();
});

Problem Genealogy

  • 2015 (window.onload & SpeedIndex): Measured technical load events that fired long after (or before) users saw content.
  • 2020 (Core Web Vitals v1, LCP, FID, CLS): Standardized user-perceived loading and stability, though First Input Delay (FID) only measured the first click's input delay.
  • 2024 (INP Replaces FID): Measured all interactions through full frame presentation, exposing bloated hydration and synchronous Layout Thrashing in production.

Production Pitfalls

Production Pitfall
  • Optimizing Lighthouse instead of p75 field data: Lab runs test a cold load with zero clicks; INP failures only appear when real users type, filter, and scroll.
  • Client-side-only LCP elements: Hiding the hero image behind a useEffect fetch adds full JS download + parse + hydration latency to LCP.
When Not to Use
  • When not to use 0 ms micro-optimizations: Once all three vitals sit comfortably inside the Good p75 band, further micro-optimizations yield diminishing returns compared to fixing conversion or reliability bugs.

Connections & Logical Next Steps