-
Notifications
You must be signed in to change notification settings - Fork 13
prog_026
Jaycee Zhang edited this page Nov 6, 2019
·
2 revisions
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
Wiki: wiki.jcix.top ~聚沙成塔~ Blog: blog.jcix.top