Skip to the page

Cross-cutting concerns (the O in RADIO) · senior

Performance at scale

Set budgets on Core Web Vitals measured at the 75th percentile of real users (LCP ≤ 2.5 s, INP ≤ 200 ms, CLS ≤ 0.1). Then ship less JavaScript, render fewer DOM nodes, serve right-sized images and keep the main thread free for input.

The notes

What you must know

  • Core Web Vitals: LCP (loading), INP (responsiveness; it replaced FID in March 2024), CLS (visual stability; a unitless score). INP = input delay + processing + presentation delay, worst interaction per visit, p75 of field data.
  • Field data (RUM, CrUX) decides; lab tools (Lighthouse, DevTools) are for debugging.
  • JavaScript: route-level and component-level code splitting; load rare heavy features on interaction (composer, emoji picker, video player, maps); budgets enforced in CI. Facebook's redesign loads in tiers: skeleton first, then above-the-fold, then the rest.
  • DOM: virtualise long lists (render visible rows + overscan); or use content-visibility: auto with contain-intrinsic-size (Baseline since September 2024) for long static sections.
  • Images: srcset/sizes, AVIF/WebP from an image CDN, lazy-load below the fold, fetchpriority='high' on the LCP image and never lazy-load it, width/height or aspect-ratio to avoid CLS.
  • Main thread: split long tasks (> 50 ms); yield with scheduler.yield() where available (still limited availability) or setTimeout; move heavy work to a Web Worker; batch real-time updates per animation frame.
  • Network and caching: preconnect, HTTP/2 or 3, Brotli, immutable hashed assets, prefetch the next route on hover or viewport.
  • Fonts: subset, preload one critical font, font-display: swap or optional.

The red pen

Common traps: mistake → fix

  • Mistake: CLS is measured in seconds

    Fix: it is a unitless score; good is ≤ 0.1.

  • Mistake: FID is a Core Web Vital

    Fix: INP replaced it in March 2024.

  • Mistake: A Lighthouse score of 100 means users are happy

    Fix: field data at p75 is what counts.

  • Mistake: Memoise everything

    Fix: measure first; the React Compiler already memoises in compiled apps.

Easy to hard

Questions interviewers ask, easy to hard

  1. What are the Core Web Vitals today and their good thresholds?
  2. Your product listing has a poor LCP on low-end Android. Walk me through the fix.
  3. INP is 600 ms when users type in search. How do you find and fix it?
  4. How do you stop performance from regressing over time?

Practise

Practise with these questions

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview