Go theorytheory 0/50 · 0%
Runtime · hard

40. Profiling with pprof

CPU, heap, block and goroutine profiles.

net/http/pprof exposes live profiles; go tool pprof visualises them as flame graphs. Profile the real workload before optimising: hot spots are usually allocation, JSON handling or lock contention rather than the code you suspect.

Check your understanding

  1. 1. Which profile reveals lock contention?

  2. 2. Optimisation should start with…