Budgets for Frontend Performances
A performance budget is a limit set on a measurable quantity, such as JavaScript kilobytes, image weight or LCP time, that a page must not exceed. Budgets are checked automatically in CI so that regressions fail a pull request instead of reaching users unnoticed.
Stage: Measure · Part of the Frontend Performance roadmap · Last reviewed 19 November 2026
What to learn in Budgets
- Choose budget metrics that match user experience, not only file size
- Set a JavaScript budget based on a target device and network
- Enforce limits in CI using Lighthouse CI or bundler size checks
- Track bundle growth over time with a bundle analyser
- Negotiate trade-offs when a new feature exceeds the budget
Budgets interview questions
How do you decide a reasonable performance budget?
Start from a user goal such as LCP under 2.5 seconds on a mid-range phone over a slow connection, measure a current baseline, and compare competitors. Then derive limits for bytes and requests that make that goal achievable, and tighten gradually.
Why enforce budgets in CI rather than review them manually?
Regressions come from small changes, like one new dependency, that nobody notices in review. An automated check fails the build the moment a limit is crossed, so the cost is discussed while the change is fresh and easy to reverse.
Where Budgets fits in the Frontend Performance roadmap
Budgets belongs to the Measure stage (beginner level), which takes about 10 hours. Know your numbers.
Other units in this stage
Back to the full Frontend Performance roadmap