Performance Budgets as Engineering Discipline
Performance budgets ratchet down or hold. Without them, performance degrades quietly with every release.
Why budgets prevent drift
Performance regressions are gradual; nobody notices any single one; cumulatively the site is slow a year later.
Budgets catch each regression at PR time.
Four budget categories
- 1. Bundle size.
- 2. p99 endpoint latency.
- 3. Memory per request.
- 4. CPU per request.
Per-budget threshold
Bundle size: ratchet down; never let increase without justification.
p99 latency: hold within 5% of last release.
Memory + CPU: hold within 10% of baseline.
Each PR’s impact measured.
CI integration
CI step: load test + assertion. Bundle-size analyzer + assertion. Fail PR if budget exceeded without ‘allow-regression’ tag.
Allow-regression with justification + dated cleanup ticket.
Antipatterns
- No budgets. Drift wins.
- Budgets without enforcement. Decoration.
- Allow-regression as default. Defeats the discipline.
What to do this week
Three moves. (1) Apply this pattern to your slowest production endpoint. (2) Measure p99 before/after. (3) Document the win and ship the runbook so the team can reproduce.