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-
Security Assessment
Detected risks:
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 filesInstall golang-benchmark
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
samber/cc-skills-golang