Tip: Use the built-in go test flags if you need to profile your benchmarks:
-test.cpuprofile
-test.memprofile
-test.mutexprofile
-test.blockprofile
$ go test -bench=BenchmarkX -test.cpuprofile profile.out
$ go tool pprof profile.out
-test.cpuprofile
-test.memprofile
-test.mutexprofile
-test.blockprofile
$ go test -bench=BenchmarkX -test.cpuprofile profile.out
$ go tool pprof profile.out
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.