Profile CPU usage

Run benchmarks, collect a CPU profile and open it in interactive pprof

go test -cpuprofile=cpu.prof -bench=. ./... && go tool pprof cpu.prof

tool
go10 commands
tags
godebugperformance

More go commands

all 10 go commands