Mental Model for Go
Profiling
Misc
Here is an overview of the profilers built into the Go runtime.
CPU
Memory
Block
Mutex
Goroutine
Production Safety
✅
⚠️ 1
✅ 2
Safe Rate
default
❌ 1
100
1000 goroutines
1000
Max Stack Depth
64
32
32 - 100 3
Profiler Labels
❌
✅ 3
The ThreadCreate Profiler is not listed because it’s broken.
The block profiler can cause 5% or more CPU overhead, even when using a high rate value.
Before Go 1.19, this profile caused O(N) stop-the-world pauses where N is the number of goroutines. Expect ~1-10µsec pause per goroutine.
Depends on API.