go-performance

Profile Go programs and optimize CPU, memory, and latency bottlenecks.

17|Updated May 24, 2014
One-click install
npx skills add https://github.com/blacktop/dotfiles --skill go-performance-blacktop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-performance
Source: https://github.com/blacktop/dotfiles/tree/main/ai/skills/go-performance
Command: npx skills add https://github.com/blacktop/dotfiles --skill go-performance-blacktop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers measure, diagnose, and improve the performance of Go programs by identifying and resolving CPU, memory, and latency bottlenecks.

Core Features & Use Cases

  • Performance Measurement: Set up and run benchmarks using go test and benchstat.
  • Profiling: Collect and analyze CPU, heap, allocation, mutex, and block profiles using pprof.
  • Tracing: Generate and interpret execution traces for concurrency and scheduler issues.
  • Optimization Guidance: Provides best practices for code optimization, including algorithmic improvements and memory management.
  • Use Case: Diagnose why a critical Go service is experiencing high latency under load by profiling its CPU and memory usage, identifying the hot spots, and applying targeted optimizations.

Quick Start

Use the go-performance skill to benchmark the myFunction in the current directory and analyze the results.

Frequently Asked Questions about go-performance

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

FAQPage Schema
How do I profile Go code to find CPU and memory bottlenecks?

Profile Go code by collecting and analyzing CPU, heap, allocation, mutex, and block profiles using `pprof` to identify specific performance bottlenecks in your application.

What's the best way to write and compare Go benchmarks?

Write and run benchmarks using `go test`, then compare benchmark results deterministically using `benchstat` to verify performance improvements or regressions in your Go code.

How do I investigate high latency and concurrency contention in a Go service?

Investigate latency and contention by generating and interpreting execution traces to diagnose concurrency issues, scheduler delays, and blocking calls within your Go service.

Can I use this to apply Profile-Guided Optimization to hot-path Go code?

Yes, you can apply PGO and tune hot-path Go code, requiring `go test`, `benchstat`, and `pprof` tooling for deterministic measurement and analysis.

Do I need specific tooling to optimize Go program performance?

Yes, optimizing Go program performance requires `go test`, `benchstat`, and `pprof` tooling to ensure deterministic measurement, profiling, and analysis of your code.