neart.ai
EcosystemStoryHow We BuildPricingBlog
Try Inspected →
neart.ai
EcosystemStoryHow We BuildBlog

Ní neart go cur le chéile

A SaltCore Group Limited company

© 2026 neart.ai · SaltCore Group Limited. All rights reserved.

Software Quality

How Do You Set Realistic Performance Budgets and Enforce Them in CI?

25 December 20254 min read

## The short answer


A performance budget is a set of explicit limits on metrics that affect speed — things like total page weight, number of requests, JavaScript bundle size, or a target load time — that your application must not exceed. You set realistic ones by basing them on real user data and competitive benchmarks rather than wishful thinking, and you enforce them by wiring automated checks into your CI pipeline so that any change pushing you over budget fails the build before it ships.


The point of a budget is to stop the slow, invisible creep of performance regression. Without one, every feature adds a little weight, nobody notices any single increase, and a year later the site is twice as heavy and half as fast.


## Three kinds of budget


Budgets generally fall into three categories, and a good programme uses all three:


- **Quantity-based budgets**: hard limits on countable things — total bytes, image weight, number of HTTP requests, third-party script count. Easy to measure and reason about.

- **Milestone-timing budgets**: limits on user-centric timing metrics such as Largest Contentful Paint or Interaction to Next Paint. Closest to actual experience but more variable.

- **Rule-based scores**: thresholds on a composite tool score. Convenient as a single gate, but treat them as a guardrail, not the whole story.


Quantity budgets are the most reliable to enforce in CI because they're deterministic; timing metrics fluctuate with the test environment and need more careful handling.


## How to set realistic limits


The biggest mistake is plucking numbers from the air. Ground them instead:


1. **Start from real user data.** Look at the devices and networks your audience actually uses. A budget tuned for fast desktops on fibre is useless if half your traffic is mid-range mobiles on patchy connections.

2. **Benchmark against competitors.** If you want to feel faster than the alternative, your budget should be tighter than theirs.

3. **Anchor to a business target.** Tie the budget to an experience goal — for example, the page should be usable within a certain time on a representative mobile connection.

4. **Set it slightly tighter than today, then ratchet.** If you're currently at a given page weight, set the budget just below and tighten over time as you optimise. A budget you're already breaking is just an alert.

5. **Leave headroom for variance.** Timing metrics vary run to run; a too-tight timing budget produces flaky builds and erodes trust.


## Enforcing budgets in CI


A budget nobody enforces is a suggestion. The value comes from automation:


- **Measure on every pull request.** Run your performance check as part of the pipeline so the impact of a change is visible before merge.

- **Fail the build on a breach.** A hard failure for quantity budgets is appropriate — they're deterministic. For timing budgets, consider a warning threshold and a separate, more generous hard-fail threshold to absorb noise.

- **Compare against a baseline.** Reporting the delta versus the main branch ("this PR adds 40KB of JavaScript") is far more actionable than an absolute number.

- **Make the output readable.** A clear comment on the PR showing what changed and by how much turns the budget from a gatekeeper into a helpful teammate.

- **Test in a consistent environment.** Run checks on comparable hardware and network throttling each time, or timing results will be noise.


## Handling the inevitable pushback


Budgets create friction, and that's by design — but the friction needs to be fair. A few practices keep teams onside:


- **Allow deliberate, reviewed exceptions.** Sometimes a feature genuinely justifies extra weight. Make raising the budget a conscious, documented decision rather than a silent override.

- **Attribute the cost.** Show which dependency or asset caused the breach so the owner can act, rather than blaming whoever happened to push next.

- **Review budgets periodically.** As the product and audience evolve, so should the limits. A stale budget gets ignored.


## A minimal starting point


If you have nothing today, start small and grow:


1. Pick two or three deterministic quantity budgets (e.g. JavaScript bundle size and total page weight).

2. Set them just below current values.

3. Add a CI check that reports the delta on every PR and fails on a breach.

4. Once that's trusted, layer in timing-metric budgets with sensible noise tolerance.


Building this kind of automated quality gate into a delivery pipeline is precisely the sort of enterprise-grade engineering discipline neart.ai brings to its products.


## Takeaway


Performance budgets stop slow, silent regression by turning speed into a hard limit. Ground your numbers in real user data, start with deterministic quantity budgets set just below today's values, enforce them automatically in CI with clear per-PR feedback, and allow reviewed exceptions so the system stays fair and trusted.

Related posts

Software Quality

How Do You Ship Software Without Regressions?

Software Quality

What Is End-to-End Testing, and When Should You Use It?

Software Quality

What Does WCAG 2.2 Mean for Your Testing Strategy?