Skip to content

docs: add fork-budget rule with census method and measured limits#812

Merged
Chemaclass merged 1 commit into
mainfrom
docs/perf-fork-budget-rule
Jul 16, 2026
Merged

docs: add fork-budget rule with census method and measured limits#812
Chemaclass merged 1 commit into
mainfrom
docs/perf-fork-budget-rule

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

The fork-reduction series (#801-#811) produced measurement techniques and — equally valuable — measured dead ends that would otherwise be re-discovered (or worse, "optimized" into regressions) by the next contributor or agent touching src/.

💡 Changes

  • New path-scoped rule .claude/rules/perf-fork-budget.md: shim-census method (and why bash -x counts are inflated), the replacement patterns that worked, where pure bash measurably loses to awk, and the current per-run fork budgets enforced by the regression tests.
  • Auto-loads when editing src/** so future perf work starts from evidence.

Records how PRs #801-#811 measured forks (PATH-shim census as ground truth;
bash -x traces overcount via re-echoed test output), the replacement patterns
that worked, and — equally important — the measured dead ends (bash loops lose
to awk beyond ~100 lines, ${var//} is quadratic on bash 3.2, single-file build
is not faster, tput width is snapshot-load-bearing). Auto-loads when editing
src/ so future perf work starts from evidence instead of re-profiling.
@Chemaclass Chemaclass added the documentation Improvements or additions to documentation label Jul 16, 2026
@Chemaclass Chemaclass self-assigned this Jul 16, 2026
@Chemaclass Chemaclass merged commit 788cf49 into main Jul 16, 2026
6 checks passed
@Chemaclass Chemaclass deleted the docs/perf-fork-budget-rule branch July 16, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant