Performance budget

On this page 7

A performance budget is a set of measurable limits that a website or web application agrees not to exceed, such as a maximum JavaScript size, a maximum number of requests or a target value for Largest Contentful Paint. In web performance practice, it turns the vague goal of a fast site into explicit, testable thresholds that every design and code change is checked against.

A budget works like a financial budget: adding a new feature that costs weight or time requires removing or optimizing something else, or a conscious decision to raise the limit. Its value lies less in the numbers themselves than in making performance a shared constraint for designers, developers, product owners and marketing teams.

Types of performance budget metrics

Performance budgets fall into three main families: quantity budgets limit the resources a page ships, timing budgets limit user-centric metrics, and rule-based budgets limit audit scores. Mature teams combine them, because each family catches a different kind of regression.

The table below compares the families with examples and their main strengths and weaknesses.

Budget familyExample limitsStrengthWeakness
Quantity basedJavaScript under 170 KB compressed, under 50 requestsEasy to enforce at build timeWeak link to actual user experience
Timing basedLCP under 2.5 s, INP under 200 msDirectly reflects user experienceNoisy and harder to test in CI
Rule basedLighthouse performance score at least 90Single simple numberWeighted composite that hides causes
Custom milestonesHero image visible within 2 sTied to business-critical contentRequires custom instrumentation
Families of budget metrics

Quantity budgets act as leading indicators that warn before users suffer, while timing budgets act as lagging indicators that confirm whether the experience is actually acceptable. Relying on one family alone leaves blind spots.

How to set realistic budget values

A good budget starts from real user conditions and competitor baselines, not from arbitrary round numbers. The usual process measures the current site, measures several competitors, and sets targets that beat the fastest competitor or the current state by a meaningful margin, often around 20 percent, which is roughly the difference users begin to notice.

Budgets should be defined for a representative device and network, typically a mid-range Android phone on a slow 4G connection, because high-end developer machines hide most problems. The Core Web Vitals thresholds published by Google provide widely accepted timing targets at the 75th percentile of page loads.

MetricGood thresholdMeasured at
Largest Contentful Paint2.5 s or less75th percentile of field data
Interaction to Next Paint200 ms or less75th percentile of field data
Cumulative Layout Shift0.1 or less75th percentile of field data
Total Blocking Time200 ms or lessLab test on throttled device
Time to First Byte800 ms or less75th percentile of field data
Commonly used timing thresholds

Budgets are most useful when scoped per page type. A product listing, an article and a checkout have different content and different business stakes, so a single site-wide limit tends to be either too loose for simple pages or unreachable for complex ones.

Enforcing a performance budget in the workflow

A budget that is only written in a document is ignored within weeks, so enforcement must be automated and visible. The strongest approach integrates checks into the build and continuous integration pipeline, where a pull request that exceeds a limit is flagged or blocked before release.

  • Bundler limits in tools such as webpack or Vite warn when asset sizes exceed configured thresholds.
  • Lighthouse CI runs lab audits on each change and compares results with a budget file.
  • Bundle size checks report the size difference of each pull request directly in code review.
  • Real user monitoring alerts the team when field metrics cross thresholds after release.
  • Synthetic monitoring tracks key pages on a fixed schedule from controlled locations.

The response to a breach should be defined in advance. Typical policies allow the team to optimize existing code, remove a feature or third-party script, or document a deliberate decision to increase the limit with approval from the product owner.

A performance budget is a governance tool, while many neighboring terms in web performance describe measurement methods or optimization techniques. The comparison below clarifies where each one fits.

PracticePrimary purposeRelationship to the budget
Core Web VitalsStandard user-centric metricsCommon source of timing limits
Real user monitoringMeasure experience of actual visitorsVerifies timing budgets in the field
Synthetic monitoringRepeatable lab measurementsEnforces budgets before and after release
Code splittingReduce JavaScript loaded up frontTechnique used to stay within limits
Service level objectiveReliability target for a serviceSimilar concept applied to availability
Budget versus related performance practices

Limitations and common mistakes

Performance budgets fail most often through poor choice of metrics or lack of ownership, not through technical difficulty. A budget that nobody is accountable for drifts upward each time an exception is granted.

MistakeConsequenceBetter approach
Budgeting only total page weightHeavy JavaScript hidden among light imagesSeparate limits per resource type
Testing on developer hardwareBudgets pass while real users waitThrottle to a mid-range mobile profile
Ignoring third-party scriptsTag managers silently consume the budgetInclude third parties with a named owner
Raising limits after each breachBudget loses all meaningRequire a documented trade-off decision
Single lab run per changeNoise produces false alarmsUse median of several runs
Frequent budget pitfalls

A budget also cannot guarantee a good experience on its own. Staying under every limit still allows poor loading order or layout shifts, so budgets work best alongside regular profiling and field data review.

The simple explanation

A performance budget is a spending limit for speed. A family might decide to spend no more than a set amount on groceries each month. A website team similarly decides how heavy and how slow its pages may become.

Each new picture, script or feature costs some of that budget. When the budget is full, something has to give. The team either removes something old or makes a careful decision to spend more. The result is a site that stays fast as it grows, instead of slowing down little by little.

How it is used in practice

The web team of a regional news publisher notices that article pages have grown slower over two years, with field LCP at the 75th percentile reaching 4.1 seconds on mobile. The team sets a budget for article pages of 150 KB of compressed JavaScript, an LCP of 2.5 seconds and a Total Blocking Time of 200 milliseconds, measured on a throttled mid-range phone profile.

Lighthouse CI is added to the pull request pipeline and fails any change that exceeds the limits. To get under budget, the team removes two unused analytics tags, lazy loads the comment widget and preloads the main article image. Within three months, field LCP falls to 2.3 seconds, and later attempts to add a new advertising script are blocked until an older one is removed.