practice

Performance Budget Enforcement

A stated limit on bundle size or a timing metric that fails a build when exceeded, which is what turns performance from a periodic project into a constraint.

Front-end performance degrades by accretion. No single change is responsible; each adds a small dependency, another analytics script, one more font weight. Six months later the page is twice its size and there is no commit to point at.

A budget makes each increment visible at the moment it happens. The main bundle may not exceed a stated size; the largest contentful paint on the reference device and network may not exceed a stated time. Exceeding it fails the build, and the author sees the cause while they still have the context.

Two properties determine whether it survives. It must measure the right thing — compressed transfer size rather than raw, and a timing metric on a throttled reference configuration rather than on CI hardware. And it must have an override path with a recorded justification, because there will be a legitimate reason to exceed it and a budget with no exception route gets deleted the first time it blocks a launch.

The related practice is attribution: reporting which dependency grew, so the conversation is about a specific library rather than about a number.