Performance Budget Enforcement
Per-PR enforcement.
Overview
Performance budget enforcement treats latency, bundle size, and Lighthouse scores as contracts the codebase keeps PR by PR. Without enforcement, performance is whatever the codebase happens to produce after a thousand small additions; with enforcement, every PR either fits the budget or carries an explicit override with rationale. The point is not zero overrides; the point is that regressions are visible and chosen rather than accidental.
- Per-PR enforcement. Budget violations fail CI; the merge does not happen until the regression is fixed or explicitly overridden.
- Bundle size budgets. Per-page JS limits; webpack-bundle-analyzer or equivalent produces the number, CI compares against the budget.
- API latency budgets. Per-endpoint p99 limits in CI load tests; the budget catches regressions before production catches them.
- Lighthouse CI plus override-with-rationale. Per-PR Lighthouse runs catch frontend regressions; overrides require a written rationale logged to the PR for audit.
The approach
The practical approach is per-PR CI gates that fail loudly on violation, justified overrides with rationale logged for audit, per-tier budgets matched to product priority, and a quarterly review that adjusts budgets as the workload evolves. The system is designed to make regressions visible, not to block velocity.
- Per-PR gates. CI runs the budget check; violation fails the build; the developer sees the regression at PR time, not in production.
- Justified overrides. Rationale required and logged on the PR; the team can audit which overrides were taken and why.
- Per-tier budgets. Critical pages and endpoints get tighter budgets; admin or low-traffic surfaces get looser ones. The budget matches the user impact.
- Quarterly review plus documented policy. Budgets reviewed against real-world data quarterly; per-tier budget rationale committed to the engineering handbook.
Why this compounds
Budget enforcement compounds across PRs. Each blocked regression preserves performance the user experiences; each override teaches the team where the budget is too tight or the workload has shifted. After a year, the team has performance data per tier and a culture where performance is a first-class engineering concern rather than a quarterly cleanup.
- User experience. Budgeted pages stay fast; the user-visible performance does not erode silently.
- Engineering culture. Performance becomes part of every PR conversation; engineers think about cost at write time, not retrofit time.
- SLO alignment. Budgets ladder into SLOs; the contract at the PR level supports the contract at the customer level.
- Institutional knowledge. Each violation teaches a regression pattern; the team grows a vocabulary for performance work.
Performance budget enforcement is an engineering discipline that pays off across years. Nova AI Ops integrates with performance telemetry, surfaces budget trends, and supports the team’s performance discipline.