Aijin Yuan (Vince)
2 min readNov 20, 2015

--

(pprof) top
13356 of -19412 total ( -69%)
flat flat% sum% cum cum%
10923 -56% -56% 10923 -56% runtime.deferproc.func1
1365 -7% -63% 1365 -7% runtime.malg
910 -4.7% -68% 910 -4.7% math/big.nat.make
158 -0.81% -69% 158 -0.81% crypto/tls.(*Conn).readHandshake
0 -0% -69% 0 -0% bufio.(*Reader).Peek
0 -0% -69% 0 -0% bufio.(*Reader).Read
0 -0% -69% 0 -0% bufio.(*Reader).fill
0 -0% -69% 0 -0% bufio.(*Writer).Write
0 -0% -69% 0 -0% bufio.(*Writer).flush
0 -0% -69% 0 -0% bytes.(*Buffer).ReadFrom
(pprof) list runtime.deferproc.func1
Total: -19412
ROUTINE ======================== runtime.deferproc.func1 in /usr/local/go/src/runtime/panic.go
10923 10923 (flat, cum) -56% of Total
. . 67: sp := getcallersp(unsafe.Pointer(&siz))
. . 68: argp := uintptr(unsafe.Pointer(&fn)) + unsafe.Sizeof(fn)
. . 69: callerpc := getcallerpc(unsafe.Pointer(&siz))
. . 70:
. . 71: systemstack(func() {
10923 10923 72: d := newdefer(siz)
. . 73: if d._panic != nil {
. . 74: throw("deferproc: d.panic != nil after newdefer")
. . 75: }
. . 76: d.fn = fn
. . 77: d.pc = callerpc

--

--

Aijin Yuan (Vince)

iOS/Android/Web developer. UX engineering lead at Grab. Singapore/Hong Kong/Shanghai