pprof usage and performance analysis. Use when profiling applications.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
Using pprof for performance analysis.
Use when identifying performance bottlenecks.
# During tests
go test -cpuprofile=cpu.out -bench=.
# Analyze
go tool pprof cpu.out
# Web interface
go tool pprof -http=:8080 cpu.out
# During tests
go test -memprofile=mem.out -bench=.
# Analyze
go tool pprof mem.out
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/heaphttp://localhost:6060/debug/pprof/goroutine(pprof) top # Top functions
(pprof) list # Source code view
(pprof) web # Graph view
(pprof) pdf # PDF output