Go Benchmarking & Performance Measurement
A measurement-first Go skill covering benchmark authoring, pprof profiling, benchstat statistical comparison, and CI regression detection.
Dev & CodingIntermediate★ 428⑂ 45AI score 9/10Last updated: Sep 23, 2026
What it does
- Establishes benchmark conventions: one
_bench_test.goper source file, withBenchmark*functions ordered to mirror the source. - Provides worked examples for
b.Loop()(Go 1.24+),b.ReportAllocs(),b.ReportMetric(), and table-driven sub-benchmarks. - Documents run flags (
-benchmem,-count,-benchtime,-cpuprofile,-trace) and how to readns/op,B/op,allocs/op. - Enforces statistical discipline with
benchstat: never claim a win on a~(non-significant) result, always include thegoos/goarch/cpuline in commits. - Links out to reference docs for pprof, execution traces, compiler escape/inlining analysis, CI gating (benchdiff, cob, gobenchdata), and Prometheus runtime metrics.
Who it's for
- Go developers who must back performance PRs with reproducible numbers.
- Teams that want statistically sound conclusions instead of one lucky run.
- Platform engineers adding performance regression gates to CI.
Examples
- Measure a
sync.Poolrefactor before/after with-count=10and paste the benchstat table into aperf(parser):commit body. - Implement competing optimization hypotheses in isolated worktrees, then benchmark each serially against one shared baseline and keep the winner.
- When a benchmark reports unexpected allocations, capture a memprofile and follow the compiler-analysis reference to find what escaped to the heap.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/aiskillstore/marketplace/HEAD/pending/samber/golang-benchmark/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the pending/samber/golang-benchmark folder from the GitHub repo aiskillstore/marketplace into my ~/.claude/skills/golang-benchmark/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/samber/cc-skills-golang.git /tmp/cc-skills-golang && mkdir -p ~/.claude/skills && cp -r /tmp/cc-skills-golang/golang-benchmark ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Verify the Go toolchain:
go version(Go 1.24+ recommended forb.Loop()). - Install the statistics tool:
go install golang.org/x/perf/cmd/benchstat@latest - Make sure
$(go env GOPATH)/binis on your PATH sobenchstatresolves. - Clone the skill repository:
git clone https://github.com/samber/cc-skills-golang.git - Copy the skill folder:
mkdir -p ~/.claude/skills && cp -r cc-skills-golang/golang-benchmark ~/.claude/skills/ - Confirm the
references/subfolder (pprof, benchstat, trace, ci-regression, etc.) came along. - Restart Claude Code and try: "write a benchmark for this function and compare before/after with benchstat".