Tag Pprof
Part 2: CPU Profiling Deep Dive - Understanding Where Time Actually Goes
My service was slow at 28ms per request. I could have guessed the cause - database, JSON, strings? Instead, I profiled it. The results surprised me.
pprof quick start: profile a Go service in 10 minutes
I spent two weeks optimizing a function that accounted for 0.3% of my program’s runtime. Meanwhile, a JSON call was eating 45% of CPU. pprof would have shown me in seconds.
1