Skip to main content

Measuring: Core Web Vitals and Budgets

intermediate20 min readLesson 109 of 143

LCP, INP, CLS โ€” the three numbers users feel โ€” plus performance budgets that keep you honest over time.

Performance without measurement is folklore. The industry standard is Core Web Vitals โ€” three user-perceived metrics.

The three vitals

  • LCP (Largest Contentful Paint) โ€” when the main content appears. Good < 2.5s. Usually the hero image or headline block. Enemies: slow server (TTFB), render-blocking resources, lazy-loaded hero, unoptimized images.
  • INP (Interaction to Next Paint) โ€” worst-ish input latency across interactions. Good < 200ms. Enemies: long tasks on the main thread, giant event handlers.
  • CLS (Cumulative Layout Shift) โ€” how much content jumps. Good < 0.1. Enemies: images without dimensions, late-loading fonts/banners/ads, injected content above existing content.

All three are field metrics โ€” measured on real users (CrUX, RUM). Lab tools (Lighthouse) approximate them for diagnosis.

The loop

  1. Measure in the field (or a controlled lab reproduction).
  2. Diagnose โ€” which phase is slow? TTFB? Download? Script? Layout? Each has a different fix; optimizing the wrong one is effort theater.
  3. Fix the biggest thing first โ€” one change, not seven.
  4. Re-measure. Same tool, same conditions. Did the number move?
  5. Guard it with a budget (below), so the win survives the next feature.

Performance budgets

A budget is a number in CI: "the JS bundle must stay under 170KB compressed; LCP under 2.5s on a mid-tier phone." Tools (bundlesize, Lighthouse CI, size-limit) fail the build when crossed. Without a budget, performance regresses silently โ€” every "small" script and "temporary" image wins against nobody.

Budget categories worth setting: total JS compressed, total CSS, largest image, number of third-party requests, LCP lab score. Start from the current numbers minus 20% โ€” budgets you can't meet get ignored.

Device and network honesty

Test on slow devices and throttled networks โ€” DevTools can throttle CPU 4โ€“6ร— and network to "Slow 4G". Your MacBook Pro lies to you; the median user's phone doesn't. The lab targets: mid-tier Android, 4G, cold cache.

Now practice

Vitals & Budgets โ€” PracticeCompute CLS from layout shifts, grade vitals against thresholds, and enforce a multi-part budget.3 challenges ยท ยท ~18 minSlow Page Clinic โ€” PracticeThe diagnose-first workflow made runnable: measure a deliberately broken page spec, find its dominant cost, fix, and verify.3 challenges ยท ยท ~25 min