Performance budgets
Limits on page weight, load time or latency that a team agrees not to exceed.
A performance budget turns speed into a constraint that is checked automatically, often in CI. It stops slow creep, one dependency at a time. Budgets work best when tied to metrics users feel, such as Core Web Vitals.
Why it matters for a product engineer
Pages rarely become slow in one change. They become slow one library, image and script at a time, and each change looks small in its pull request. A budget turns speed into a limit that the build checks, so a product engineer sees the cost of a change before users feel it.
How to do it
- Choose metrics people feel: the Core Web Vitals from real users (LCP within 2.5 s, INP of 200 ms or less, CLS of 0.1 or less, at the 75th percentile). Add the sizes that cause them, such as compressed JavaScript.
- Set the limits from a real device and network, not from your own laptop. Alex Russell’s 2024 baseline for a 3-second load on a slower phone is about 730 KiB compressed, with no more than 365 KiB of JavaScript.
- Check the sizes in CI on every pull request, with Lighthouse or a bundle size tool. Fail the build when a page goes over.
- Check the field metrics every week. Lab results miss slow phones and slow networks.
- When a feature needs more, remove something else, or change the budget on purpose, with a written reason.
Common mistakes
- A budget that nobody checks automatically.
- Limits copied from the current size, which only keeps a slow page from getting slower.
- A budget for JavaScript only, while HTML, images or fonts grow.
- Third-party scripts outside the budget.
- Raising the limit every time a check fails.
Example
This site’s home page was measured on 23 November 2026, as a phone-width browser loads it, with each file compressed as the server sends it. JavaScript is only 5.7 KiB, because the pages are static. The HTML is 152 KiB, because the page draws the whole Skills Map as SVG, with 1,830 paths. The site has no budget check in CI yet. The HTML is the number such a check should watch first.
This site's home page against a 3-second budget
The page is well under the JavaScript share. The HTML, not the script, would reach a limit first.
MeasuredCompressed sizes of the home page, 23 Nov 2026; budget from Alex Russell, Jan 2024
Sources: The performance inequality gap, 2024 (Alex Russell) ↗ · Web vitals (web.dev) ↗
Resources
1- articleStart here
Web vitals ↗
web.dev (Google) · 2020 · 12 minThe three metrics Google uses for loading, responsiveness and visual stability, and their thresholds.
Tools
1- ToolOpen source
Lighthouse
Open-source audits for performance, accessibility, SEO and best practices, built into Chrome.