AI Skill MartBrowse skillsPromptsProgramsLearnWhat is a Skill?
← Back to list

Go Benchmarking & Performance Measurement

A measurement-first Go skill covering benchmark authoring, pprof profiling, benchstat statistical comparison, and CI regression detection.

Dev & CodingIntermediate★ 427⑂ 45AI score 9/10Last updated: Sep 24, 2026

What it does

  • Establishes benchmark conventions: one _bench_test.go per source file, with Benchmark* 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 read ns/op, B/op, allocs/op.
  • Enforces statistical discipline with benchstat: never claim a win on a ~ (non-significant) result, always include the goos/goarch/cpu line 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

  1. Measure a sync.Pool refactor before/after with -count=10 and paste the benchstat table into a perf(parser): commit body.
  2. Implement competing optimization hypotheses in isolated worktrees, then benchmark each serially against one shared baseline and keep the winner.
  3. 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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
↓ Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on AI 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.

  1. Verify the Go toolchain: go version (Go 1.24+ recommended for b.Loop()).
  2. Install the statistics tool: go install golang.org/x/perf/cmd/benchstat@latest
  3. Make sure $(go env GOPATH)/bin is on your PATH so benchstat resolves.
  4. Clone the skill repository: git clone https://github.com/samber/cc-skills-golang.git
  5. Copy the skill folder: mkdir -p ~/.claude/skills && cp -r cc-skills-golang/golang-benchmark ~/.claude/skills/
  6. Confirm the references/ subfolder (pprof, benchstat, trace, ci-regression, etc.) came along.
  7. Restart Claude Code and try: "write a benchmark for this function and compare before/after with benchstat".