samber avatar

Golang Benchmark

Comprehensive Go performance measurement workflow that covers benchmarks, profiling, and statistical comparison. Use this when you need to prove an optimization actually worked or track performance regressions in CI. It defaults to `b.Loop()` for Go 1.24+, generates CPU and memory profiles straight from benchmark runs, and pushes benchstat for rigorous statistical analysis. The persona enforces no single-run conclusions, which is refreshing. Pairs with the golang-performance skill for actual optimization patterns after you've measured the problem. The commit message format suggestion with benchstat output is solid practice for documenting performance work.

skills.sh installs
41K
GitHub stars
3.8K
last updated
Aug 21, 2026

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-benchmark --agent claude-code

Installs into .claude/skills of the current project.

Files

Persona: You are a Go performance measurement engineer. You never draw conclusions from a single benchmark run — statistical rigor and controlled conditions are prerequisites before any optimization decision.

Thinking mode: Reason as thoroughly as possible for benchmark analysis, profile interpretation, and performance comparison tasks — deep reasoning prevents misinterpreting profiling data and ensures statistically sound conclusions. On Claude Code, use ultrathink to trigger extended thinking explicitly.

Dependencies:

  • benchstat: go install golang.org/x/perf/cmd/benchstat@latest

Go Benchmarking & Performance Measurement

Performance improvement does not exist without measures — if you can measure it, you can improve it.

This skill covers the full measurement workflow: write a benchmark, run it, profile the result, compare before/after with statistical rigor, and track regressions in CI. For optimization patterns to apply after measurement, → See samber/cc-skills-golang@golang-performance skill. For pprof setup on running services, → See samber/cc-skills-golang@golang-troubleshooting skill.

Writing Benchmarks

File and Ordering Conventions

Sponsors

Details

Repository
github.com/samber/cc-skills-golang
Categories
Documentation, Debugging, Go
First seen
Apr 16, 2026

More from samber/cc-skills-golang

All 47
1samber avatargolang-dependency-injectionsamber/cc-skills-golangComprehensive guide for dependency injection (DI) in Golang. Covers why DI matters (testability, loose coupling, separation of concerns, lifecycle management), 41Kskills.sh installs
2pexoai avatarpexo-agentpexoai/pexo-skillsAI video generation skill with auto model selection across Seedance 2, Kling 3.0, HappyHorse, and 10+ models. Produces finished multi-shot videos (5–120s) from 40.6Kskills.sh installs
3wshobson avatarpython-testing-patternswshobson/agentsImplement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, o40Kskills.sh installs
4heygen-com avatarstyle-samplingheygen-com/hyperframesMake a new episode in a proven video style - Collage Explainer, Finance Explainer, Animated Science Explainer, 3D Brand Explainer, 3D True Crime - on the person38.8Kskills.sh installs
5samber avatargolang-spf13-cobrasamber/cc-skills-golangGolang CLI command tree library using spf13/cobra — cobra.Command, RunE vs Run, PersistentPreRunE hook chain, Args validators (NoArgs, ExactArgs, MatchAll, cust38.6Kskills.sh installs
6samber avatargolang-graphqlsamber/cc-skills-golangImplements GraphQL APIs in Golang using gqlgen or graphql-go. Apply when building GraphQL servers, designing schemas, writing resolvers, handling subscriptions,38.5Kskills.sh installs