What problem does it solve?
This Skill prevents misleading Go performance decisions by teaching you to benchmark, profile, and compare results with proper statistical and methodological discipline.
Core Features & Use Cases
- Benchmark writing that avoids dead-code elimination: Prefer b.Loop() on Go 1.24+ and structure setup vs timed work correctly.
- Reliable benchmark execution: Use -count and -benchmem to gather repeatable timing and allocation data, and capture output for later comparison.
- Rigorous before/after comparison: Interpret benchstat output correctly (including confidence intervals and the ~ “not significant” indicator) and avoid p-hacking.
- Profiling from benchmark findings: Generate CPU/heap/trace artifacts from go test runs and use pprof/trace guidance to explain where time and allocations come from.
- CI regression detection: Select appropriate tooling (benchdiff, cob, gobenchdata) and mitigate noisy-neighbor issues so performance gates are trustworthy.
- Performance investigation playbook: Use references to connect symptoms (benchmarks/profiles/metrics) to root-cause hypotheses and next diagnostic steps.
Quick Start
Ask an agent: “Using the golang-benchmark skill, show me how to write a correct Go benchmark for my hot function, run it with statistical confidence, and explain the benchstat results before I merge my optimization.”