Part 10 · 2 chapters · ~12 min

Performance

From what users feel to what you measure: Core Web Vitals and their phases, field and lab, percentiles and device tiers, attribution, the usual costs, the techniques, and the budgets that hold.

22

Metrics and measurement

What users feel, how it is measured, and how the cause is attributed.

Core Web Vitals

metricp75 thresholdsLCP≤ 2.5 s good · > 4 s poorINP≤ 200 ms good · > 500 ms po…CLS≤ 0.1 good · > 0.25 poor

Google's three field metrics for loading, responsiveness and visual stability: LCP, INP and CLS, judged at the 75th percentile.

in practiceSearch Console reports, CrUX, RUM dashboards; the thresholds every performance budget starts from.

LCP

TTFBload delayload timerender delay2100 msthe four LCP phases

Largest Contentful Paint: when the largest image or text block in the viewport rendered; a proxy for "the main content is here".

in practiceThe hero image or headline; attribution splits it into TTFB, load delay, load time and render delay.

deep dive: Browser P12

INP

input delayprocessingpresentation340 msclick → next paint

Interaction to Next Paint: the slowest (near-worst) interaction latency in a visit, from input to the next frame, split into input delay, processing and presentation.

in practiceSlow click handlers, long tasks blocking input, heavy re-renders after a keypress.

FCP

navigationFCPfirst contentLCPmain content

First Contentful Paint: when any text or image first rendered; the end of the blank screen.

in practiceRender-blocking CSS and scripts delaying it; the first thing a slow-network user sees.

deep dive: Browser P12

TBT

task 120 mstask 40 mstask 90 ms290 msTBT = 70 + 0 + 40 = 110 ms

Total Blocking Time: the sum of the over-50 ms portions of long tasks between FCP and interactive; the lab proxy for INP.

in practiceLighthouse's heaviest-weighted score input; hydration and big bundles drive it.

deep dive: Browser P12

Field data vs lab data

fieldreal users, devicesa distributionp75 per tierwhat happenedlabone device, one runreproducibletraceswhy it happened

Field (RUM, CrUX) measures real users on real devices as a distribution; lab (Lighthouse, WebPageTest) measures one run in a controlled setup.

in practiceA perfect Lighthouse score with poor CrUX numbers; the lab explains, the field decides.

deep dive: Disciplines P4

Percentile (p75, p95)

p50p75p95p999.0 s LCP

The value below which that share of samples fall; p75 is what three-quarters of users get or better.

in practiceVitals judged at p75; averages hiding slow tails; never average percentiles across segments.

deep dive: Disciplines P5

CrUX

Chrome usersopted inCrUX28-day p75PSI, BigQuer…

The Chrome User Experience Report: Google's public dataset of field Core Web Vitals from opted-in Chrome users, by origin and URL.

in practicePageSpeed Insights field section; the data search ranking uses.

deep dive: Browser P12

Performance budget

used 182 KBheadroombudget 250 KB

Limits on metrics or resources (LCP, INP, KB of JS) per page and device tier, enforced in CI and monitored in the field.

in practicesize-limit failing a PR; a Lighthouse CI assertion; an alert on field regression.

deep dive: Disciplines P4

Device tier

high (8 GB+, 8 cores)INP p75 90 msmid (4 GB)INP p75 180 mslow (2 GB)INP p75 420 ms

Grouping users by device capability (memory, cores) so performance is measured and budgeted for the slow phones, not the average.

in practicenavigator.deviceMemory and hardwareConcurrency in RUM; the 2 GB Android tier in emerging markets.

Throttling (CPU, network)

dev laptop1×mid Android≈ 4× CPUlow Android≈ 6×+ CPUSlow 4G150 ms RTT, 1.6 Mbps

Slowing the CPU or network in DevTools or Lighthouse to approximate slower devices and connections.

in practice4× or 6× CPU slowdown; "Slow 4G" presets; an approximation, not a real low-end phone.

deep dive: DevTools P5

Performance marks and measures

performance.mark('search:start');await renderResults();performance.measure('search', 'search:start');// shows in the Timings track and RUM

performance.mark and measure for your own named timings, visible in traces and readable by RUM.

in practice"search-results-rendered" marks; User Timing in the Performance panel's Timings track.

deep dive: Browser P12
THE PERFORMANCE LAYER, IN ORDER
from what users feel to what you measure, what slows it and how it is held
swipe the figure sideways, or tap expand for full screen
1/6
metrics
Metrics: LCP for loading, INP for responsiveness, CLS for stability, judged at p75; FCP and TBT as supporting lab signals.
23

Costs, techniques and budgets

Where the time usually goes, the techniques that remove it, and the gates that keep it removed.

Long Animation Frame (LoAF)

frame (210 ms)script: checkou…style + layout210 ms

An API reporting frames that took over 50 ms with the scripts responsible, sources and durations: attribution for INP.

in practicePerformanceObserver for long-animation-frame entries; script URLs and function names in RUM.

Critical rendering path

HTMLCSS (…rende…layoutpaint

The sequence from HTML to first paint: HTML, CSS, render-blocking scripts, render tree, layout, paint; shortening it speeds first render.

in practiceInlining critical CSS, deferring scripts, preloading the LCP resource.

deep dive: Browser P0

Main-thread work

Scripting1,840 msRendering (style, layout)420 msPainting120 msIdle…

Time the main thread spends on script, style, layout and paint; the budget input and interactions compete for.

in practiceLighthouse's "Minimize main-thread work" breakdown; the Summary tab in a trace.

deep dive: DevTools P5

Third-party cost

your apptag managerchat widgetanalytics300 ms main thread

The performance cost of scripts from other origins (tags, chat, analytics, ads): connections, bytes and main-thread time you do not control.

in practiceLighthouse third-party summary; facades for chat widgets; loading tags after interaction.

deep dive: Architecture P5

Facade

static previ…3 KBuser clicksload real wi…600 KB

A lightweight placeholder that looks like a heavy embed (video player, chat widget) and loads the real thing on interaction.

in practicelite-youtube-embed; "Chat with us" buttons that load the SDK on click.

deep dive: Architecture P5

Back/forward cache

eligibleback = instantstate preservedpageshow persistedblockedunload listenerno-store, open WSfull reload

Keeping a page's full state in memory on navigation away, so back and forward restore it instantly.

in practiceunload handlers and Cache-Control: no-store making pages ineligible; the bfcache test in DevTools Application.

deep dive: Browser P10

Speculation Rules

<script type="speculationrules">{ "prerender": [{ "where": { "href_matches": "/product/*" }, "eagerness": "moderate" }] }</script>

A JSON script telling the browser to prefetch or prerender likely next pages, so navigation is near-instant.

in practice<script type="speculationrules"> with eagerness settings; prerendered product pages from a listing.

deep dive: Browser P10

Hydration cost

HTML visibleJS downloadhydrate (blocki…interactive440 ms

The main-thread time to download, parse and run the framework and component code that re-renders server HTML on the client.

in practiceTBT and INP spikes after load; islands, partial hydration, Server Components and resumability reduce it.

Image CDN

/hero.jpg?w=…image CDNresize, AVIF42 KBcached at edge

A service that resizes, recompresses and reformats images on the fly per request (width, AVIF/WebP, quality).

in practiceURL parameters like ?w=800&fm=avif; responsive srcsets without storing every variant.

deep dive: FSD P3

Resource hints summary

dns-prefetchDNS onlypreconnectDNS + TCP + TLSpreloadfetch now, highmodulepreloadfetch + parse moduleprefetchnext page, low

dns-prefetch, preconnect, preload, modulepreload, prefetch and prerender: telling the browser about work before it discovers it.

in practiceOne preconnect per critical third-party origin; preload only what is critical; prefetch for next pages.

deep dive: Browser P1

Bundle budget

JanMarMaybudget205 KB entrythe gate fails in May

A byte limit per chunk (compressed) enforced in CI, so JavaScript cannot grow unnoticed.

in practicesize-limit, bundlesize; the 2 KB a day slow rot.

deep dive: Architecture P1

Performance regression

4.164.174.184.19 (fix)340 ms INP p75

A measurable worsening of a metric tied to a change, found in the lab gate, the ring comparison, or the field trend.

in practiceAn alert cut by route, tier and release; the release diff as the suspect list.

deep dive: Disciplines P4