Go tooling in action
大鬍子小哥教go
ofollow,noindex">youtube channel
go tooling in action
主要介紹了一下命令工具,最後用profile做了個webserver的優化
- Command
go list -f '{{ join .Imports "\n"}}' go list -f '{{ join .Imports "\n"}}' log go doc fmt go doc fmt printf godoc -http :6060 go tool vet
-
debug daemon
-
test
table driven test
直接發請求測試
-
用火焰圖調優
go-wrk go tool pprof go-torch go test bench
- 正則表示式build一次
- 不用正則表示式
- set http header type
感想
先profile,再調優。收集到詳細可信的資料,問題即使不能解決,至少清楚在哪裡了。
另
關於daemon到討論很有意思
https://github.com/golang/go/issues/227