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
-
go list ./...Print the import paths of all packages in the module
-
gofmt -w .Reformat all .go files in the current directory tree
-
go vet ./...Find likely bugs in Go code before they find you
-
GOOS=linux GOARCH=amd64 go build -o bin/app ./cmd/appCross-compile a Go binary for Linux/amd64
-
go test -race -count=1 ./...Run all tests without cache and check them for data races