Performance
Bundle budgets: multiple-choice review
Six questions that cut across the whole unit. Each mirrors a call you make in a real perf review — not a definition to recite, but which lever actually moves the number under load.
Confirm you can connect the four-phase cost model, Core Web Vitals thresholds, the splitting/tree-shaking/compression hierarchy, the third-party tax, and CI enforcement — the synthesis the individual lessons built toward.
Team A ships brotli instead of gzip and cuts transfer from 180 KB to 150 KB. Team B code-splits the same route from 600 KB to 200 KB uncompressed. Both report LCP wins. Which team actually reduced CPU cost, and why?
A page loads in 800 ms on the developer's M-series laptop but sits blank for ~8 s on a mid-range Android. TTFB is 70 ms on both. What is the dominant cause?
A team's P75 LCP is Poor but P75 CLS is Good. They cut the route bundle from 700 KB to 200 KB. LCP and INP improve; CLS barely moves. Why is that the expected outcome?
A developer writes `import { debounce } from 'lodash'` and the analyzer shows 70 KB, not 2 KB. They already set `sideEffects: false` on their own package. What is the actual cause and fix?
An app spends a sprint cutting its first-party bundle from 800 KB to 350 KB; a month later the data team adds Segment, Hotjar, and Intercom (~450 KB) via GTM and the win is erased. Which control would have caught this before it shipped?
Lighthouse CI on every PR reports P75 LCP 2.1 s; production RUM shows 4.8 s P75 on mobile for the same route. A senior reads this as:
The unit’s through-line is one decision tree: bytes equal four CPU phases (download is network, parse/compile/execute are the user’s CPU), so the real levers reduce shipped bytes — splitting first, then tree shaking, with compression as a transport-only finisher. Core Web Vitals quantify the cost (LCP/INP move with JS, CLS does not). Third-party scripts are the silent budget killer that first-party gates cannot see, so they need their own budget plus CSP. And none of it holds without enforcement: size-limit in CI, RUM in production, a ratcheting budget-raise protocol against drift.