test: add benchmarks, examples, and bench-regression guard (#15)#24
Merged
test: add benchmarks, examples, and bench-regression guard (#15)#24
Conversation
Complete the Phase 4 benchmark scaffolding:
* syncmap_bench_test.go now has 28 benchmarks: one per public
method (with hit/miss / loaded/stored variants where meaningful),
a concurrent 90/10 read-write pattern, and five Overhead pairs
comparing the generic wrapper against raw sync.Map.
* example_test.go adds runnable godoc Example functions for all
12 public symbols plus the two top-level CompareAnd* funcs.
Range/Keys/Values/Map sort their output so // Output: blocks
stay deterministic.
* bench.txt seeds the committed baseline (darwin/arm64, count=5).
* scripts/check-bench-regression.sh parses benchstat output and
fails on time/op regressions >= 10% at p <= 0.05 or any positive
allocs/op delta. Ported from axonops/mask with two fixes: skip
geomean summary rows and exclude zero-delta matches so the guard
is stable against itself.
* Makefile: bench-regression target; ci.yml: benchstat-regression-
guard job (mirrors mask, Dependabot skip, CAVEAT preserved);
makefile-targets-guard expected list updated.
Coverage remains 100%. CONTRIBUTING §Performance baseline referenced
by the CI job is deferred to #18.
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.
Summary
Completes the Phase 4 benchmark scaffolding: a full per-method benchmark suite, overhead pairs vs raw
sync.Map, runnable godoc Examples for every public symbol, the committedbench.txtbaseline, and thebenchstat-regression-guardCI job (mirroring mask).Closes #15.
Highlights
syncmap_bench_test.go— expanded from 9 to 28 benchmarks. Covers Load (hit + miss), Store, LoadOrStore (loaded + stored), LoadAndDelete, Delete, Range, Len, Map, Keys, Values, a concurrent 90/10 read-write pattern (pre-computed key pool so allocs/op isn't dominated by the harness), and five Overhead pairs (Load/Store/LoadOrStore/Delete/LoadAndDelete each with syncmap vs raw sync.Map).example_test.go— 14 runnableExample*functions, one per public symbol. Iterators (Range/Keys/Values/Map) sort output so// Output:blocks are deterministic. All passgo test -run Example.bench.txt— committed baseline from darwin/arm64,-count=5. Header documents regen procedure and the CI consumer.scripts/check-bench-regression.sh— ported from mask with two fixes: skipgeomeansummary rows and exclude zero-delta matches. The script is now stable against itself (abench.txt → bench.txtcompare reports zero regressions, which mask's original would false-positive on).bench-regressiontarget..github/workflows/ci.yml—benchstat-regression-guardjob (benchstat pinned to same version as mask, Dependabot skip, shared-runner CAVEAT preserved).makefile-targets-guardexpected list updated to includebench-regression..gitignore—bench-regression.txt,current.txt.Local validation
Agent gates
Deferrals
bench.txt— docs: add README, CHANGELOG, NOTICE, SECURITY, and LLM docs bundle #17.Test plan
benchstat-regression-guardbenchstat-reportartefact uploaded from the guard job