golang-performance

Analyze Go performance bottlenecks using profiling and benchmark-driven optimization patterns.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Go performance tuning is a complex, error-prone process; this Skill provides a structured catalog of optimization patterns, measurement discipline, and practical guidelines to reduce allocations, improve CPU efficiency, optimize memory layout, tune GC behavior, and accelerate hot-path code, all driven by profiling feedback.

Core Features & Use Cases

  • Profiling-guided optimizations: leverage pprof, fgprof, and tracing to locate real bottlenecks.
  • Pattern-driven techniques: allocation reduction, inlining-friendly coding, cache locality, pooling, batching, and preallocation strategies.
  • Benchmark-driven iterations: define atomic benchmarks, compare before/after with benchstat, and document changes for audit trails.

Quick Start

Identify a hot path with profiling, run a baseline benchmark, apply one targeted optimization, and re-run benchmarks to measure improvement.

Frequently Asked Questions about golang-performance

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

FAQPage Schema
How do I find Go performance bottlenecks using profiling?

To find Go performance bottlenecks, use profiling tools like pprof, fgprof, and tracing to locate real hot paths. This Skill guides you in analyzing these profiles to pinpoint exact CPU and memory allocation issues before applying targeted optimizations.

What is the best way to reduce memory allocations in Golang?

The best way to reduce memory allocations in Golang involves applying pattern-driven techniques like pooling, batching, and preallocation strategies. This Skill provides a structured catalog of these patterns to help you minimize heap pressure effectively.

How do I run benchmarks to validate Go optimization changes?

To validate Go optimization changes, define atomic benchmarks, apply one targeted optimization, and re-run them to measure improvement. This Skill emphasizes using benchstat to compare before/after results and document changes for reliable audit trails.

Can I use these optimization patterns for microservices and production Go services?

Yes, you can use these optimization patterns for production Go services, microservices, and libraries. The techniques are specifically designed for environments where profiling, benchmarks, and hot-path optimization are critical requirements.

How does GC tuning improve Golang application performance?

GC tuning improves Golang application performance by optimizing garbage collection behavior to reduce pause times and memory overhead. This Skill covers actionable GC tuning strategies alongside memory layout improvements and cache locality techniques for hot-path code.