Last active
January 7, 2020 05:27
-
-
Save mannharleen/4ed5615de02cd89e6f16e05b75b1e077 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// given package name "del" | |
// has a function named "f1" | |
go build -gcflags "-m -m" | |
// profile using only Test... (NOT POSSIBLE) | |
// benchmark results | |
go test -run=xx -bench=. -benchmem | |
// benchmark & profile (mem and cpu) results | |
go test -run=xx -bench=. -benchmem -memprofile mem.prof -cpuprofile cpu.prof | |
// pprof mem | |
go tool pprof -alloc_space del.test mem.prof | |
> list f1 | |
> top10 | |
// pprof cpu | |
go tool pprof del.test cpu.prof | |
> top | |
// other references: | |
// https://gist.github.com/arsham/bbc93990d8e5c9b54128a3d88901ab90 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment