Slide 1

Slide 1 text

Go pro ling Steve Carrupt Nulab Software Developer

Slide 2

Slide 2 text

Agenda pprof go-torch Demo Questions

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

CLI pro ling example

Slide 5

Slide 5 text

Web pro ling example

Slide 6

Slide 6 text

go-torch Easier to read pro ling data with ame graphes

Slide 7

Slide 7 text

Demo github.com/scarrupt/go-pro ling (https://github.com/scarrupt/go-pro ling)

Slide 8

Slide 8 text

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)

Slide 9

Slide 9 text

Thank you Steve Carrupt Nulab Software Developer @stevecarrupt (http://twitter.com/stevecarrupt)