askill
performance-profiling

performance-profilingSafety 90Repository

pprof usage and performance analysis. Use when profiling applications.

1 stars
1.2k downloads
Updated 2/5/2026

Package Files

Loading files...
SKILL.md

Performance Profiling Skill

Using pprof for performance analysis.

When to Use

Use when identifying performance bottlenecks.

CPU Profiling

# During tests
go test -cpuprofile=cpu.out -bench=.

# Analyze
go tool pprof cpu.out

# Web interface
go tool pprof -http=:8080 cpu.out

Memory Profiling

# During tests
go test -memprofile=mem.out -bench=.

# Analyze
go tool pprof mem.out

HTTP Endpoint

import _ "net/http/pprof"

func main() {
    go func() {
        log.Println(http.ListenAndServe("localhost:6060", nil))
    }()
    // your code
}

Access profiles at:

  • http://localhost:6060/debug/pprof/
  • http://localhost:6060/debug/pprof/heap
  • http://localhost:6060/debug/pprof/goroutine

pprof Commands

(pprof) top      # Top functions
(pprof) list     # Source code view
(pprof) web      # Graph view
(pprof) pdf      # PDF output

Best Practices

  • Profile in production-like conditions
  • Profile before optimizing
  • Focus on hot paths
  • Check both CPU and memory
  • Use flamegraphs for visualization

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

85/100Analyzed 2/18/2026

High-quality technical reference skill on Go pprof usage. Provides comprehensive coverage of CPU profiling, memory profiling, HTTP endpoint setup, and pprof commands with clear examples. Well-structured with a dedicated 'When to Use' section, tags for discoverability, and organized in a skills folder. Content is generic and reusable across any Go project. Minor gaps include lack of flamegraph details and troubleshooting guidance, but overall excellent reference material.

90
85
90
70
85

Metadata

Licenseunknown
Version-
Updated2/5/2026
PublisherIvanTorresEdge

Tags

apitesting