Skip to content
Painter
Guides

Your build has a budget. Here is how to set it

One number in CI does more for performance than any audit you run by hand. A two-week plan for teams whose scope keeps moving.

A performance budget is not a target. It is a tripwire. Its whole job is to make somebody notice on the pull request that added the weight, rather than in the quarterly review three months later.

Two weeks, start to finish

  1. Week one: measure, do not enforce.Record the numbers on every build. Change nothing. You are looking for the normal range.
  2. Week two: set the tripwire above today.Ten per cent above the current worst build. It should not fire yet.
  3. Then ratchet.Every time you make a real improvement, lower the number to just above the new normal.

Set it above where you are, not where you wish you were

A budget that fails on the first pull request gets switched off in a week. One that fires four times a year gets respected.
{
  "budgets": [
    { "path": "/",         "javascript": 180, "css": 40 },
    { "path": "/checkout", "javascript": 240, "css": 40 }
  ]
}
Budget starter with the ratchet scriptJSON and shell, 6 KBDownload Budget starter with the ratchet script

Leave a comment

Real questions get real answers. The editorial team reads every thread.