A performance budget defines limits for metrics like page weight, load time, or Lighthouse scores. It helps teams maintain performance by setting clear, measurable targets.
Types of performance budgets
Quantity-based
- Maximum page weight (e.g., 500KB)
- Maximum JavaScript size (e.g., 200KB)
- Maximum number of requests (e.g., 50)
Timing-based
- LCP under 2.5 seconds
- TTI under 3.8 seconds
- Speed Index under 3.4 seconds
Score-based
- Lighthouse Performance ≥90
- All Core Web Vitals "Good"
Setting a performance budget
- Benchmark current performance
- Research competitors
- Define meaningful thresholds
- Get team buy-in
- Integrate into CI/CD
Enforcing budgets
In CI/CD
- Lighthouse CI
- Size-limit
- bundlewatch
Example configuration
{
"budgets": [{
"resourceType": "script",
"budget": 200
}]
}
Benefits of performance budgets
- Prevents performance regression
- Creates shared accountability
- Informs feature decisions
- Maintains user experience
Related Terms
Core Web Vitals
A set of three metrics defined by Google that measure the loading performance, interactivity, and visual stability of a web page.
Lighthouse
An open-source automated tool by Google for auditing the quality of web pages, measuring performance, accessibility, SEO, and more.
Synthetic Monitoring
A type of performance monitoring that uses automated scripts to simulate user interactions and measure performance in controlled conditions.
Web Performance
The speed at which web pages are downloaded and displayed in the user's browser, and how responsive they are to user interaction.