prog_026 - zhangjaycee/real_tech GitHub Wiki
perf stat MY_PROGRAM先record再report。
perf record MY_PROGRAM
perf reportgo自带的test 和 tool pprof可以作profiling[1]:
例子:
go test -cpuprofile=cpu.out -blockprofile=block.out
# 结果打印在命令行
go tool pprof --text MY_PROGRAM cpu.out
# 结果生成PDF图片
go tool pprof --pdf MY_PROGRAM cpu.out > cpu.pdf