golang-performance

Diagnose Go performance bottlenecks from pprof and fgprof profiles.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Go services and libraries suffer from hard-to-find performance issues such as excessive allocations, GC pressure, CPU-bound hot loops, lock contention, and off-CPU I/O waits; this skill helps diagnose and prescribe targeted fixes so you optimize the right hotspot instead of guessing.

Core Features & Use Cases

  • Profile-first methodology: Guided workflow to define metrics, gather pprof/fgprof/traces, create atomic benchmarks, and validate improvements with benchstat.
  • Allocation & memory guidance: Patterns to reduce allocs, avoid backing-array leaks, use sync.Pool safely, and reorder structs for optimal layout.
  • CPU, concurrency & I/O fixes: Advice on inlining, ILP, cache locality, false-sharing mitigation, connection-pool tuning, and batching strategies.
  • Production tuning & observability: Recommendations for GOGC/GOMEMLIMIT/GOMAXPROCS, continuous profiling, Prometheus queries, and CI benchmark regression detection.
  • Use case: When pprof or fgprof shows a hotspot, run this skill to get a prioritized, single-change optimization plan with concrete benchmark commands and expected measurement steps.

Quick Start

Profile your Go process (pprof or fgprof) and provide the CPU and heap profiles, then ask for a single prioritized optimization with the benchmark commands to verify improvement.

Frequently Asked Questions about golang-performance

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

FAQPage Schema
How do I reduce Go memory allocations and GC pressure from pprof hotspots?▼

To reduce Go allocations and GC pressure, this skill analyzes pprof heap profiles to prescribe sync.Pool usage, backing-array leak fixes, and struct layout reordering, providing atomic benchmark commands to validate the memory reduction.

What is the best way to optimize Go CPU hot paths identified in a flamegraph?▼

The best way to optimize Go CPU hot paths is applying inlining, instruction-level parallelism, and cache locality improvements, then validating the single-change fix with benchstat to ensure measurable performance gains.

How do I tune GOMEMLIMIT and GOMAXPROCS for Go production services?▼

Tune GOMEMLIMIT and GOMAXPROCS by using this skill to evaluate production profiling data, yielding specific environment variable recommendations and Prometheus queries for continuous performance observability.

Can I use fgprof to diagnose off-CPU I/O waits in Go server-side libraries?▼

Yes, you can use fgprof to diagnose off-CPU I/O waits in Go libraries; this skill processes fgprof traces to prescribe connection-pool tuning and batching strategies that resolve lock contention and wait times.

How do I set up CI benchmark regression detection for Go performance?▼

Set up Go benchmark regression detection by generating atomic benchmarks for single-change validation, running them continuously in CI with benchstat to catch performance degradations before deployment.