Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Go profiling(Geeks Who Drink発表資料) / Go profiling

Go profiling(Geeks Who Drink発表資料) / Go profiling

6月28日のGeeks Who Drinkで、ヌーラボのSteveがお話しした、Golangに関する発表資料です。

More Decks by 株式会社ヌーラボ

Other Decks in Programming

Transcript

  1. pprof CPU, heap, blocks, routines pro lers provided by the

    Go runtime Get pro ling data through Benchmark tests $ go test -v -run=^$ -bench=^ -cpuprofile=prof.cpu $ go tool pprof [binary].test prof.cpu pprof HTTP handlers import _ net/http/pprof $ go tool pprof http://localhost:8080/debug/pprof/profile code runtime.StartCPUPro le or runtime.WriteHeapPro le
  2. Questions The real problem is that programmers have spent far

    too much time worrying about e ciency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming. Donald Ervin Knuth sources: golang.org/pkg/net/http/pprof/ (https://golang.org/pkg/net/http/pprof/) github.com/uber/go-torch (https://github.com/uber/go-torch)