Back to Skills

golang-benchmark

Golang benchmarking, profiling, and performance measurement. Use when writing, running, or comparing Go benchmarks, profiling hot paths with pprof, interpreting CPU/memory/trace profiles, analyzing results with benchstat, setting up CI benchmark regression detection, or investigating production performance with Prometheus runtime metrics. Also use when the developer needs deep analysis on a specific performance indicator - this skill provides the measurement methodology, while `samber/cc-skills-

1,807stars118forksUpdated 5/24/2026

Security Assessment

Medium Risk(60/100)

Detected risks:

Privilege Escalation([references/ci-regression.md] sudo)
Security Score60/100

About golang-benchmark

The golang-benchmark skill provides a structured workflow for benchmarking, profiling, and performance measurement in Go applications. It is designed to help developers produce statistically reliable performance data instead of relying on single benchmark runs or anecdotal observations. The skill focuses on measurement methodology, including writing accurate benchmarks, running repeatable benchmark suites, profiling CPU and memory usage, interpreting profiling output, and comparing performance changes with statistical rigor. It emphasizes controlled conditions and disciplined analysis before making optimization decisions.

The skill includes guidance for modern Go benchmarking practices such as using `b.Loop()` in Go 1.24+ for safer and more accurate benchmark timing, memory allocation tracking with `b.ReportAllocs()`, custom metric reporting, and table-driven or sub-benchmark patterns. It also supports workflows for comparing benchmark results with tools like `benchstat`, analyzing runtime behavior with profiling tools such as `pprof`, and integrating benchmark regression detection into CI environments. In addition, it references production-oriented measurement approaches using Prometheus runtime metrics and supports investigation of specific performance indicators.

This skill is intended for Go developers, performance engineers, and AI coding agents working on Golang projects where performance analysis and measurement are critical. Typical use cases include benchmarking new code paths, comparing before-and-after optimization results, diagnosing performance regressions, profiling memory or CPU hotspots, validating scalability changes, and establishing repeatable performance testing pipelines in development or CI systems. It is especially useful for teams that require statistically sound performance analysis before applying optimization techniques.

FAQ

What Go versions are supported by this skill?

The skill supports modern Go projects and includes recommendations for Go 1.24+ features such as `b.Loop()`. Legacy `b.N` benchmark loops are also supported for older Go versions.

What external tools are required to use this skill?

The skill requires the Go toolchain and the `benchstat` utility. The documentation also references profiling and benchmark analysis tools such as `pprof` and related benchmarking utilities.

Can this skill optimize Go code automatically?

No. This skill focuses on benchmarking, profiling, and measurement methodology. It helps developers gather and interpret performance data but does not provide optimization patterns directly.

Does the skill support benchmark comparison and regression tracking?

Yes. The skill includes workflows for comparing benchmark results using statistical analysis tools such as `benchstat` and for integrating benchmark regression detection into CI pipelines.

Who should use this skill?

The skill is designed for Go developers, performance engineers, and AI coding agents that need reliable benchmarking, profiling, and performance measurement workflows for Golang applications.

All Files

10 files
SKILL.md10.9 KB
View
references/investigation-session.md7.1 KB
View
references/benchstat.md14.1 KB
View
references/compiler-analysis.md10.6 KB
View
references/tools.md3.9 KB
View
references/ci-regression.md10.4 KB
View
references/trace.md17.9 KB
View
references/pprof.md33.0 KB
View
evals/evals.json81.1 KB
View
references/prometheus-go-metrics.md11.3 KB
View

Install golang-benchmark

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill