go-performance

Optimize Go code with strconv conversions and pre-sized containers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go performance patterns including efficient string handling, type conversions, and container capacity hints help developers optimize Go code and reduce latency in performance-critical sections.

Core Features & Use Cases

  • Efficient string handling: prefer strconv over fmt for primitive-to-string conversions.
  • Memory and allocation optimizations: pre-size containers, reuse buffers, and reduce allocations.
  • Range of patterns: string handling, type conversions, and container capacity hints with practical examples.
  • Use Case: When optimizing a high-throughput Go service, apply these patterns to minimize allocations and improve latency.

Quick Start

Identify a performance hotspot in your Go project and apply the recommended patterns to optimize string handling and memory allocations.

Frequently Asked Questions about go-performance

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

FAQPage Schema
How do I reduce memory allocations in Go hot paths?

Reduce memory allocations in Go hot paths by pre-sizing containers, reusing buffers, and preferring strconv over fmt for primitive-to-string conversions to minimize heap pressure and latency.

Why is strconv faster than fmt for Go string conversions?

strconv is faster than fmt for Go string conversions because it avoids the reflection overhead and formatting allocation costs required by fmt, directly converting primitives to strings with lower latency.

What is the best way to optimize Go server performance for high throughput?

Optimize Go server performance for high throughput by applying established patterns like pre-sizing slices and maps, reusing buffers, and minimizing allocations in performance-critical data processing sections.

Can pre-sizing containers improve Go benchmark results?

Pre-sizing containers can improve Go benchmark results by eliminating repeated memory allocations during slice and map growth, reducing allocation overhead and lowering latency in performance-critical sections.

When should I apply memory optimization patterns in Go?

Apply memory optimization patterns in Go when optimizing performance-critical sections such as hot paths in server code, benchmarks, and data processing where allocation and conversion costs directly impact latency.