A performance budget is a set of limits on metrics that affect user experience. Without budgets, performance degrades with every feature addition.
What to Budget
Quantity-Based Budgets
Timing-Based Budgets
Enforcing in CI
Webpack Bundle Analysis
Common Budget Violations
| Violation | Common Cause | Fix |
|---|---|---|
| JS too large | Importing entire lodash | import { debounce } from "lodash-es" |
| CSS too large | Unused styles | PurgeCSS / Tailwind purge |
| Images too large | Unoptimized images | WebP/AVIF, responsive images |
| Too many requests | No code splitting strategy | Dynamic imports, lazy loading |
Monitoring in Production
- Real User Monitoring (RUM) with web-vitals library
- Synthetic monitoring with Lighthouse CI
- Set up alerts when metrics exceed thresholds
- Track metrics over time in dashboards