Chapter 15: Performance and cost

Every one of those is easy to fix once and easy to lose again. To keep it, turn it into a check.

Performance budget

A limit you set in advance on something like bundle size or p95 latency, with a check that fails when it is broken. Speed then stops being something you remember to care about, and becomes something that says no.

This is backpressure for speed. Speed tends to get worse a little at a time, each change too small to notice, and an agent adds them faster than anyone can watch. With a budget in CI the agent gets refused in its own loop, with a number, and has to deal with it.

Say it to your agent

“Add a CI job that fails on any of these: main bundle over 200 KB compressed by size-limit, k6 p(95) over 300 ms on GET /orders, Lighthouse CLS over 0.1. The failure message must name the budget and the number. Show me each one failing once.”

The workshop

Name a word, or describe what you mean in everyday language.