Golang常見的profile使用場景
go tool pprof
go tool pprof -h # 查看 go tool pprof 命令的幫助信息
# 設置了25s的採樣時間,當25s採樣結束後,就生成了我們想要的profile文件,然後在pprof交互命令行中輸入web;
# 從瀏覽器中打開,就能看到對應的整個調用鏈的性能樹形圖。
go tool pprof --seconds 25 http://localhost:9090/debug/pprof/profile
go-torch
go-torch -h # 查看 go-torch 工具的幫助信息
參考文檔
Golang性能調優(go-torch, go tool pprof)
【GoLang】golang垃圾回收 & 性能調優
Golang 的 協程調度機制 與 GOMAXPROCS 性能調優
Go pprof性能調優
1. Go 性能調優之 —— 基準測試
2. Go 性能調優之 —— 編譯優化
3. Go 性能調優之 —— 性能測量和分析