# golang-benchmark

> Claude/Codex skill by [@samber](https://omgskills.com/library/samber/index.md) · 2.8k stars · 37k installs · Updated 2026-08-01

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-golang@golang-performance\` provides the optimization patterns.

Tags: agent, agent-skills, ai, antigravity, claude, claude-code, code, codex, coding, copilot, cursor, gemini, gemini-cli-extension, openclaw, opencode, plugin, skills, skillsmp, vibe-coding

## Install

```sh
git clone https://github.com/samber/cc-skills-golang /tmp/cc-skills-golang && ln -s /tmp/cc-skills-golang/skills/golang-benchmark ~/.claude/skills/golang-benchmark
```

## From README

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 on running services, → See samber/cc-skills-golang@golang-troubleshooting skill. Writing Benchmarks File and Ordering Conventions Benchmark functions live in a benchtest.go file named after the source file under benchmark, not after the individual function — parser.go -\> parserbenchtest.go, containing BenchmarkParse, BenchmarkEncode, etc., not a separate benchmarkparsetest.go per function. Keeping benchmarks in their own file (instead of mixed into parsertest.go) keeps go test -bench=.

## Links

- HTML page: https://omgskills.com/skills/samber/cc-skills-golang/golang-benchmark/
- GitHub: https://github.com/samber/cc-skills-golang
- Author: [@samber](https://omgskills.com/library/samber/index.md)

## More from this repo

- [golang-google-wire](https://omgskills.com/skills/samber/cc-skills-golang/skills/golang-google-wire/index.md) — Compile-time dependency injection in Golang using google/wire — wire.NewSet, wire.Build, wire.Bind...
   - [@samber](https://omgskills.com/library/samber/index.md) · 3.1k stars
- [golang-gopls](https://omgskills.com/skills/samber/cc-skills-golang/skills/golang-gopls/index.md) — Golang semantic code intelligence via \`gopls\`, the official Go language server — go-to-definition, find references,...
   - [@samber](https://omgskills.com/library/samber/index.md) · 3k stars
- [golang-how-to](https://omgskills.com/skills/samber/cc-skills-golang/skills/golang-how-to/index.md) — Golang skills orchestrator — always active on any Golang coding, review, debug, or setup task.
   - [@samber](https://omgskills.com/library/samber/index.md) · 3k stars
