ci: make bench + benchmark CI workflow - #46
Open
jmylchreest wants to merge 2 commits into
Open
Conversation
Adds a bench toolchain independent of any benchmark test files landing: - root Makefile delegates bench / bench-smoke to aide/Makefile - aide/Makefile: bench runs full -benchmem (200ms x3) over the hot-path packages (store, survey, grammar, code, memory); bench-smoke runs 1-iteration each as a cheap compile+execute guard - .github/workflows/benchmark.yml: bench-smoke job gates every PR (catches broken benchmarks cheaply; passes vacuously until benchmark files land), bench-measure job runs nightly + on main push + manual dispatch and uploads the -benchmem results as an artifact (informational, not a gate) No .go files touched. The actual benchmark _test.go files are a separate PR; until they merge, both make targets and the CI jobs no-op cleanly. Co-authored-by: Hermes <jmylchreest+hermes@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Runs the benchmark suite one package at a time (profiler disallows multiple packages in a single run) writing pprof-out/<pkg>.cpu.out and .mem.out for hotspot analysis: go tool pprof pprof-out/store.cpu.out. Complements the existing bench / bench-smoke targets. Co-authored-by: Hermes <jmylchreest+hermes@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
make bench+ benchmark CI workflowAdds a benchmark toolchain that is independent of the benchmark test files themselves (those land in a separate PR —
bench/store-paths). Until that PR merges, both make targets and this CI run cleanly with no benchmarks present.What this adds
make bench(root) →aide/Makefile bench: full-benchmem,-benchtime=200ms -count=3over the hot-path packagespkg/{store,survey,grammar,code,memory}/...make bench-smoke(root) →aide/Makefile bench-smoke:-run XXXNOTHING -benchtime=1x -count=1— proves every benchmark compiles and executes, cheap enough for every PR.github/workflows/benchmark.yml:bench-smokejob — gates every PR (2 jobs: compile/run guard). Passes vacuously until benchmark files land.bench-measurejob — runs nightly (~03:23 UTC), on push to main, and on manual dispatch. Writes the-benchmemresults to a repo-relative file and uploads as an artifact (informational — run-to-run noise does not fail CI).Why split smoke vs measure
Benchmark measurement is slow and disk/CPU-noise-sensitive; it does not belong on the PR merge path. But every PR should still guarantee benchmarks compile and run. Hence: fast vacuum-proof smoke check as the gate, full measurement off the PR path as opportunistic artifacts.
Files
Makefile.PHONYaide/Makefilebench+bench-smoketargets,.PHONY.github/workflows/benchmark.ymlNo
.gofiles touched. Action versions match existingci.yml(checkout@v7,setup-go@v7,upload-artifact@v7).Verification
make bench-smokefrom repo root → exit 0 (delegation works; packages compile; zero benchmarks pass vacuously)make bench-smokeinaide/→ exit 0benchmark.ymlparsed with Goyaml.v3→ valid; jobs =bench-smoke,bench-measuregit diff --stat: exactly 2 Makefiles + 1 new workflow, no.goCo-authored-by: Hermes jmylchreest+hermes@gmail.com