You can view current version this presentation here
This presentation is licensed under the Creative Commons Attribution-ShareAlike 4.0 International licence.
You are encouraged to remix, transform, or build upon the material, providing you give appropriate credit and distribute your contributions under the same license.
go test -bench=. -cpu=1,2,4 -run=^$ ./examples/fib/
go test -c
mv fib.test fib.golden
go test -c
./fib.golden -test.bench=. -test.count=10 > old.txt
./fib.test -test.bench=. -test.count=10 > new.txt
benchstat old.txt new.txt
go test -gcflags=-S
# disable inlining
go test -gcflags="-l -S"
var Result uint64
func BenchmarkPopcnt(b *testing.B) {
var r uint64
for i := 0; i < b.N; i++ {
r = popcnt(uint64(i))
}
Result = r
}
go test -run=XXX -bench=. -cpuprofile=c.p bytes
go tool pprof c.p
go tool pprof -http=:8080 $FILENAME
go build -gcflags=-m examples/esc/sum.go
go build -gcflags='-m -m' examples/esc/sum.go
go build -gcflags=-m examples/inl/max.go
import "github.com/pkg/profile"
func main() {
defer profile.Start(profile.TraceProfile, profile.ProfilePath(".")).Stop()
// ...
}
go tool trace trace.out