Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Pre-Requisite

Install Graphviz

Code Block
brew install graphviz



Adding a Benchmark 



Profiling your Benchmark 


Code Block
go test -bench=. -run=x -benchmem -memprofile mem.prof -cpuprofile cpu.prof -benchtime=5s > 0.bench


Profile CPU

Code Block
$ go tool pprof cpu.prof 
Type: cpu
Time: Jul 15, 2022 at 1:25pm (EDT)
Duration: 7.34s, Total samples = 7.45s (101.51%)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof)

...