Back to Plate

Repeated Unit Budget

.agents/skills/performance/rules/repeated-unit-budget.md

53.0.61.2 KB
Original Source

Repeated Unit Budget

Use this for blocks, lines, leaves, rows, decorations, shell islands, groups, or other repeated editor units.

Rule

Budget the hot repeated unit before optimizing globally.

Track:

BudgetAsk
DOM nodes per unitHow many nodes before decorations/overlays?
React components per unitHow many instances in the common case?
event handlers per unitAre handlers delegated or attached per unit?
effects per unitAre effects banned from wrappers and repeated rows?
subscriptions per unitDoes each unit subscribe narrowly by runtime id/range?
selectors per unitAre selectors O(1), stable, and dirtiness-aware?
allocations per interactionDoes typing/select/copy allocate proportional to document size?
style/layout costAny forced reflow, layout read, or heavy selector?
React scheduler/effect costDoes this unit render, mount effects, or block urgent work?

Policy

Tiny removals compound. Removing two DOM nodes per unit is 20k fewer nodes at 10k units.

Use Vercel rules for micro-tactics:

  • rerender-*
  • rendering-*
  • js-*

This rule owns the budget table and release gate.