Skip to content

ci: make bench + benchmark CI workflow - #46

Open
jmylchreest wants to merge 2 commits into
mainfrom
ci/benchmarks
Open

ci: make bench + benchmark CI workflow#46
jmylchreest wants to merge 2 commits into
mainfrom
ci/benchmarks

Conversation

@jmylchreest

Copy link
Copy Markdown
Owner

Add make bench + benchmark CI workflow

Adds 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=3 over the hot-path packages pkg/{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-smoke job — gates every PR (2 jobs: compile/run guard). Passes vacuously until benchmark files land.
    • bench-measure job — runs nightly (~03:23 UTC), on push to main, and on manual dispatch. Writes the -benchmem results 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

File Change
Makefile +2 delegation targets, .PHONY
aide/Makefile +bench +bench-smoke targets, .PHONY
.github/workflows/benchmark.yml new (2 jobs)

No .go files touched. Action versions match existing ci.yml (checkout@v7, setup-go@v7, upload-artifact@v7).

Verification

  • make bench-smoke from repo root → exit 0 (delegation works; packages compile; zero benchmarks pass vacuously)
  • make bench-smoke in aide/ → exit 0
  • benchmark.yml parsed with Go yaml.v3 → valid; jobs = bench-smoke, bench-measure
  • git diff --stat: exactly 2 Makefiles + 1 new workflow, no .go

Co-authored-by: Hermes jmylchreest+hermes@gmail.com

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

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

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>
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