Performance budget

A hard number your pages are not allowed to cross, checked automatically in CI so a slow pull request fails instead of shipping.

fail the build if it gets slowera size limit we can't crossbundle size limitmax kb per page rulespeed guardrail in CIstop the bundle from creeping upperf budgetsize-limit check on pull requests

See it

Live demo coming soon

What it is

A performance budget is a ceiling written down and enforced by a machine. Three flavors, usually combined: quantity budgets (no more than 170KB of compressed JS per route, no more than 20 requests), milestone budgets (LCP under 2.5s on an emulated mid-tier Android), and score budgets (Lighthouse performance at or above 90). Tooling is boring and mature: Lighthouse CI assertions, size-limit or bundlesize for chunks, and field-data budgets in SpeedCurve or Calibre.

Pick one policy and say it out loud, because half-stated budgets get argued away. The one worth defaulting to is non-regression with a manual ratchet: measure where you are, pin the ceiling at today's value so any growth fails the build, and lower the ceiling by hand whenever you win something back. No automatic headroom, since headroom always gets spent. The alternative anchor is competitive, pick the fastest site your users compare you to and set the budget 20 percent better than that. The number matters less than the enforcement, because a budget nobody can fail is a wish.

Gotchas: budget bytes and execution cost separately. 200KB of JPEG and 200KB of JavaScript weigh the same on the wire and nothing alike on a cheap phone, where the JS has to be parsed, compiled, and run. Budget per route or template, since a site-wide total lets one bloated page hide behind twenty light ones. And give the budget an owner: an unowned failing check gets bypassed inside a month.

Ask AI for it

Add an enforced performance budget to this repo. Wire up Lighthouse CI on pull requests, running the three highest-traffic templates on mobile emulation, with assertions failing the build when LCP exceeds 2500ms, CLS exceeds 0.1, or TBT exceeds 300ms. Add size-limit with a per-entry gzipped JS ceiling and a total-page-weight ceiling, pinned to today's measured values so any regression fails the build, with no headroom for growth; the ceilings only move down, by hand, when a change wins bytes back. Post a PR comment showing each budget, the current value, and the delta against main, and mark the check required so it blocks merge.

You might have meant

bundle sizecore web vitalscode splittingtree shakinglab data vs field data