Part III β The Speed Β· Lesson 5.1
Performance Overview
In one lineThree metrics describe what a user feels: is it there, does it respond, does it stay still.
Where you've seen itA news article that paints, then shifts as an ad slot fills β and your tap lands on the wrong link.
Diagram
THE THREE VITALS ON ONE TIMELINE
0s 1s 2s 3s 4s
βββββββββββΌββββββββββΌββββββββββΌββββββββββ€
β β
βΌ TTFB βΌ FCP βΌ LCP β
first first largest β
byte pixel content β
(server) (something) (the thing β
you came for)β
β
user taps βββΊ βΌ INP β
how long until the UI responds
β
any element moving = CLS βββββββββββ
LCP β€ 2.5s is it THERE?
INP β€ 200ms does it RESPOND?
CLS β€ 0.1 does it STAY STILL?WHAT EACH METRIC BLAMES
LCP slow ββΊ slow server (TTFB) Β· render-blocking CSS/JS
Β· unoptimised hero image Β· client-side-only rendering
INP slow ββΊ long tasks on the main thread Β· heavy event handlers
Β· huge re-renders Β· hydration still running
CLS bad ββΊ images without dimensions Β· ads/embeds injected late
Β· web fonts swapping Β· content inserted above viewportTHE MENTAL MODEL β one thread does almost everything
main thread: [parse HTML][eval JS][layout][paint] [long task 380ms]
β²
user taps here ββββ
nothing happens for 380ms
Every long task is a moment your UI is frozen.How it works
- LCP marks when the largest visible element renders β usually a hero image or headline block.
- INP measures the worst interaction latency across the visit, replacing the old FID (which only measured the first one).
- CLS sums unexpected layout shifts across the page's life, weighted by how much moved.
- All three are measured at p75 of real users (see 4.5) β a metric measured on your laptop is not a metric.
- Fix in dependency order: TTFB β render-blocking resources β LCP element β main-thread work.
Trade-offs
| Metric | Cheapest big win |
|---|---|
| LCP | Preload the hero image, cut render-blocking CSS |
| INP | Break up long tasks, defer non-critical JS |
| CLS | width/height on images, reserve ad slots |
| TTFB | CDN, edge caching, faster origin |
Interview angle
"Which metric would you optimise first, and why?"
- Start with LCP, because it usually shares a root cause with TTFB and render-blocking resources β one fix moves several numbers.
- Then INP, since main-thread work is what makes an app feel broken even after it looks loaded.
- CLS is usually the cheapest fix of the three: dimensions on media and reserved space for late-injected content.
Recap
- There, responsive, stable β LCP, INP, CLS.
- One main thread does parsing, JS, layout, and paint; long tasks freeze all of it.
- Always p75 of real users, never a single lab run.