使用输出配置文件与go tool例如:
go tool pprof testbin.test cpu.out
Run Code Online (Sandbox Code Playgroud)
我建议func Benchmark*(b *testing.B)您在分析中感兴趣的功能实现一些.
进入工具后尝试top10:
Welcome to pprof! For help, type 'help'.
(pprof) top10
Run Code Online (Sandbox Code Playgroud)
更多信息:https://blog.golang.org/profiling-go-programs
| 归档时间: |
|
| 查看次数: |
2875 次 |
| 最近记录: |