Skip to content

Instantly share code, notes, and snippets.

@Fs02
Created April 19, 2018 07:32
Show Gist options
  • Select an option

  • Save Fs02/ab64ab1f5ae82baf3f4589fcea4243aa to your computer and use it in GitHub Desktop.

Select an option

Save Fs02/ab64ab1f5ae82baf3f4589fcea4243aa to your computer and use it in GitHub Desktop.
Profiling in Go

https://bieker.ninja/go/2015/01/22/profiling-go.html

<ourProgram>.test -test.cpuprofile=cpu.prof
go tool pprof <outProgram>.test cpu.prof
Welcome to pprof!  For help, type 'help'.
(pprof) top10
Total: 1256 samples
    1074  85.5%  85.5%     1074  85.5% code.google.com/p/go.crypto/blowfish.encryptBlock
      90   7.2%  92.7%       90   7.2% runtime.usleep
      45   3.6%  96.3%       45   3.6% ExternalCode
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment