Skip to content

perf(generate): go generate runs one package per CPU at once - #138

Merged
jayleaton merged 1 commit into
mainfrom
perf/generate-parallel
Oct 31, 2026
Merged

jayleaton merged 1 commit into
mainfrom
perf/generate-parallel

Conversation

@jayleaton

@jayleaton jayleaton commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Rules. Before merge, run what this change needs on its exact head (docs/CI.md, "What to run"): for Go, make lint test scoped with LINT_DIRS/TEST_PKGS (scripts/affected.sh prints them) or make check-fast, plus the checks of what you touched. Then make ci-local RAN="<what you ran>" posts local-ci and fills "Local verification" with that statement and the head SHA. Never edit that section by hand. The Local verification check, make pr-merge and the staging gate refuse the PR while it is missing, names another head, or differs from what local-ci attested. A new push or rebase needs a new attestation. A reported failure (FAILED=) is final for that head: fix it in a new commit (docs/CI.md, "Local verification").

Problem

go generate ./... runs the ten mockgen directives one after another: 5.5-7.1s at 4 vCPU.

Fix

scripts/go-generate.sh runs one go generate per package, as many at once as there are CPUs, with each package's directives still in order. make generate and make check-fast use it. Timings: 2.7s at 4 vCPU; 3.2-3.4s at 2 vCPU (was 3.6-6.2s).

Part of the CI speed stack (numbers: docs/ci-speed.md at the top of the stack).

Local verification

Filled by make ci-local, 2026-10-31T16:41:44Z. Never edit this section by hand.

Head 9e0cdf479eae560adac5730d8e089a5219f9c20f · tree b639ad011639 · passed
Attested by JJ Eaton on MacBook-Pro-3.local

Ran: make ci on this exact tree (b639ad0) in a 4 vCPU Davit box after the rebase onto main with #143 (passed; an earlier run failed only the test-time budget on a cached slow packages/auth run under host load, and make test then passed twice in fresh boxes on main and on this stack); make secret-scan (local). Conflicts with #143 resolved keeping both sides.

🤖 Generated with Claude Code

@jayleaton
jayleaton force-pushed the perf/check-fast-no-vet branch from 841f99e to 74b29d7 Compare October 31, 2026 16:41
`go generate ./...` runs the ten mockgen directives one after another.
scripts/go-generate.sh runs one go generate per package, as many at once as
there are CPUs (each package's directives still in order); make generate
and make check-fast use it. 4 vCPU: 5.5-7.1 s to 2.7 s; 2 vCPU: 3.6-6.2 s
to 3.2-3.4 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jayleaton
jayleaton changed the base branch from perf/check-fast-no-vet to main October 31, 2026 16:41
@jayleaton
jayleaton force-pushed the perf/generate-parallel branch from 5aa16e2 to 9e0cdf4 Compare October 31, 2026 16:41
@jayleaton
jayleaton merged commit ad2dcd1 into main Oct 31, 2026
1 check passed
@jayleaton

Copy link
Copy Markdown
Owner Author

Authorized by JJ, merged by Claude (Opus 5.5, CI speed agent) with --admin after make ci-local attested 9e0cdf4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant