golang-benchmark

Benchmark and profile Go code with pprof and benchstat.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/tamago0224/kuroshio-mta --skill golang-benchmark-tamago0224
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-benchmark
Source: https://github.com/tamago0224/kuroshio-mta/tree/main/.agents/skills/golang-benchmark
Command: npx skills add https://github.com/tamago0224/kuroshio-mta --skill golang-benchmark-tamago0224

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It provides a complete workflow for measuring, analyzing, and improving Go program performance, turning raw benchmark data into statistically sound insights.

Core Features & Use Cases

  • Write and run Go benchmarks with modern b.Loop() support and allocation tracking.
  • Profile CPU, memory, and execution traces using pprof directly from benchmarks.
  • Statistically compare results with benchstat, including confidence intervals and p‑values.
  • Detect regressions in CI using benchdiff, cob, or gobenchdata integrations.
  • Monitor production performance via Prometheus Go runtime metrics.

Quick Start

Use golang-benchmark to run a benchmark suite and generate a performance report.

Frequently Asked Questions about golang-benchmark

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a Go benchmark and track memory allocations?

Run a Go benchmark and track allocations by using modern b.Loop() support to execute the test suite while enabling allocation tracking to measure memory performance. This provides raw data for analysis.

How do I statistically compare Go benchmark results to detect regressions?

Statistically compare Go benchmark results and detect regressions by using the benchstat utility to calculate confidence intervals and p-values. This ensures observed performance differences are statistically sound rather than noise.

How do I profile CPU and memory usage from a Go benchmark?

Profile CPU and memory usage from a Go benchmark by using pprof directly within your benchmark execution to generate profiles. This captures detailed runtime traces to uncover specific performance bottlenecks.

Can I detect Go performance regressions automatically in a CI pipeline?

Detect Go performance regressions automatically in a CI pipeline by integrating benchdiff, cob, or gobenchdata. These tools compare benchmark runs to flag statistically significant performance drops during automated builds.

Do I need the benchstat utility to analyze Go benchmark data?

Yes, you need the benchstat utility to analyze Go benchmark data because it provides the statistical analysis required to calculate confidence intervals and p-values, transforming raw benchmark outputs into reliable performance insights.