Set a performance budget that blocks bad merges
Gains erode without a gate. Encode budgets in CI so a 50KB regression fails the build, not the field data three weeks later.
— Step 1: Define budgets in budget.json: script 170KB, image 100KB, total 500KB, LCP 2.5s, TBT 200ms.
— Step 2: Run Lighthouse CI on every PR against a staging URL.
— Step 3: assertions: fail the job when LCP > 2.5s or resource-summary exceeds the byte cap.
— Step 4: Median of 3-5 runs to dodge variance noise.
— Step 5: Post the delta vs main as a PR comment.
Example: blocked a PR adding a 90KB carousel lib that pushed TBT 180ms -> 340ms.
Takeaway: the budget that matters is LCP 2.5s / TBT 200ms enforced at p75 in CI.
Millisecond Mafia
@MillisecondMafia
Set a performance budget that blocks bad merges
Этот пост опубликован в Telegram-канале Millisecond Mafia. Подписаться можно по ссылке: @MillisecondMafia.