go tool
(1) go tool compile -S main.go
反編譯代碼爲彙編代碼
(2) GOOS=linux GOARCH=amd64 go tool compile -S -N -l main.go
禁止內聯生成僞彙編代碼
go build
go build 命令用於編譯我們指定的源碼文件或代碼包以及它們的依賴包。
(2) go build -gcflags=-m main.go
go build -gcflags '-m -l' xxx.go
打印出編譯器逃逸分析的過程,使用 -m 參數。
go test
go test
-bench=.
-run=^$
-cpu=1,2,4
-benchtime=10s
-count=10
-benchmem
bufio