Profiler Comparison

Here is an overview of the profilers built into the Go runtime.

CPU

Memory

Block

Mutex

Goroutine

Production Safety

⚠️ 1

2

Safe Rate

default

default

1

100

1000 goroutines

Max Stack Depth

64

32

32

32

32 - 100 3

Profiler Labels

3

The ThreadCreate Profiler is not listed because it’s broken.

1(1,2)

The block profiler can cause 5% or more CPU overhead, even when using a high rate value.

2

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.

3(1,2)

Depends on API.