MADPIG: Measure and deepen performance in Go
summary
Shows concrete wins: instrumenting with pprof and Trace reveals 97% of time spent opening files, not the network; moving file reads out of the inner loop and loading whole files into memory yields a 6x speedup, refactoring to avoid repeated downloads adds another 4x, and successive changes make one version 300x faster than v0. Uses go test -bench, CPU profiler, flame graphs and the Race detector to find bottlenecks, then applies targeted code and API changes and concurrency to eliminate them.
AI-written summary · about
chapters (21)
- 0:00Start
- 6:16Performance analysis
- 7:18Rule of thumb
- 10:29What latency?
- 11:18Why improve speed?
- 12:05Levels of abstraction
- 14:07Response time vs Service time
- 16:13Running example
- 25:35Measure execution duration
- 26:06Commands
- 27:21Benchmarking
- 29:13Pprof: CPU sampling
- 30:01Counting with code coverage
- 30:57Flame graphs
- 34:48Trace of sequential work
- 35:12Trace of parallel work
- 41:57Concurrency
- 42:28Race Detector
- 43:35Cost of interface abstraction
- 45:09Escape analysis
- 46:48Inlining
related talks
29mOptimizing Go Code Without a Blindfold
40mTwo Go programs, three different profiling techniques, all in 40 minutes
45mBoost application performance with profile guided optimization
42mLesson's Learned Optimizing Performance of Go Code
44mGo Profiling and Observability from Scratch
33mBuilding a Go Profiler Using Go
14mOptimizing Go code without a blindfold
59mBeyond pprof, Hardware Performance Counters
