FAQ
I use go tool pprof to get profile, but it looks like most cpu time cost on
runtime.

59.92s of 75.94s total (78.90%)
Dropped 654 nodes (cum <= 0.38s)
Showing top 50 nodes out of 210 (cum >= 1.58s)
       flat flat% sum% cum cum%
     10.30s 13.56% 13.56% 10.30s 13.56% runtime._ExternalCode
      4.88s 6.43% 19.99% 4.88s 6.43% runtime.futex
      3.62s 4.77% 24.76% 3.62s 4.77% runtime.cas64
      3.62s 4.77% 29.52% 10.76s 14.17% runtime.scanobject
      3.57s 4.70% 34.22% 3.84s 5.06% runtime.atomicload
      3.01s 3.96% 38.19% 16.78s 22.10% runtime.findrunnable
      2.84s 3.74% 41.93% 14.37s 18.92% runtime.gcDrainUntilPreempt
      2.37s 3.12% 45.05% 8.03s 10.57% runtime.runqgrab
      2.17s 2.86% 47.91% 2.19s 2.88% runtime.atomicload64
      1.92s 2.53% 50.43% 1.92s 2.53% runtime.usleep
      1.73s 2.28% 52.71% 1.73s 2.28% runtime.xchg
      1.56s 2.05% 54.77% 1.56s 2.05% runtime.heapBitsForObject
      1.50s 1.98% 56.74% 6.19s 8.15% runtime.greyobject
      1.36s 1.79% 58.53% 1.42s 1.87% syscall.Syscall
      1.33s 1.75% 60.28% 5.22s 6.87% runtime.mallocgc
      1.24s 1.63% 61.92% 1.24s 1.63% runtime.epollwait
      1.23s 1.62% 63.54% 1.23s 1.62% runtime.mSpan_Sweep.func1
      1.19s 1.57% 65.10% 6.53s 8.60% runtime.selectgoImpl
      0.78s 1.03% 66.13% 0.79s 1.04% runtime.heapBitsSetType
      0.70s 0.92% 67.05% 0.70s 0.92% runtime.osyield
      0.69s 0.91% 67.96% 5.21s 6.86% runtime.lock
      0.68s 0.9% 68.86% 0.68s 0.9% runtime.memmove
      0.66s 0.87% 69.73% 8.70s 11.46% runtime.runqsteal
      0.64s 0.84% 70.57% 0.64s 0.84% runtime.atomicor8
      0.61s 0.8% 71.37% 1.09s 1.44% runtime.siftdownTimer
      0.56s 0.74% 72.11% 0.56s 0.74% runtime.procyield
      0.55s 0.72% 72.83% 0.55s 0.72% runtime.cas
      0.46s 0.61% 73.44% 0.46s 0.61% runtime.duffcopy
      0.42s 0.55% 73.99% 0.86s 1.13% runtime.cgocall
      0.41s 0.54% 74.53% 0.83s 1.09% runtime.scang
      0.31s 0.41% 74.94% 0.42s 0.55% runtime.deferreturn
      0.23s 0.3% 75.24% 1.92s 2.53% runtime.(*gcWork).tryGet
      0.23s 0.3% 75.55% 2s 2.63% runtime.growslice
      0.22s 0.29% 75.84% 0.57s 0.75% runtime.mapassign1
      0.21s 0.28% 76.11% 4.63s 6.10% runtime.lfstackpop
      0.21s 0.28% 76.39% 6.91s 9.10% runtime.systemstack
      0.19s 0.25% 76.64% 0.91s 1.20% runtime.gcmarkwb_m
      0.18s 0.24% 76.88% 0.78s 1.03% runtime.chansend
      0.15s 0.2% 77.07% 3.74s 4.92%
  github.com/coreos/etcd/raft.(*multiNode).run
      0.15s 0.2% 77.27% 1.47s 1.94% runtime.netpoll
      0.15s 0.2% 77.47% 3.07s 4.04% runtime.sellock
      0.14s 0.18% 77.65% 0.72s 0.95% runtime.shade
      0.13s 0.17% 77.82% 4.08s 5.37% runtime.(*gcWork).put
      0.13s 0.17% 78.00% 1.64s 2.16% runtime.mSpan_Sweep
      0.13s 0.17% 78.17% 1.06s 1.40% runtime.writebarrierptr_nostore1
      0.13s 0.17% 78.34% 1.04s 1.37%
  runtime.writebarrierptr_nostore1.func1
      0.12s 0.16% 78.50% 0.63s 0.83% fmt.(*pp).doPrintf
      0.12s 0.16% 78.65% 1.35s 1.78% runtime.heapBitsSweepSpan
      0.10s 0.13% 78.79% 17.42s 22.94% runtime.schedule
      0.09s 0.12% 78.90% 1.58s 2.08%
  github.com/coreos/etcd/raft.(*raft).Step

ROUTINE ======================== runtime.goexit in
/usr/local/go/src/runtime/asm_amd64.s
          0 45.55s (flat, cum) 59.98% of Total
          . . 1716: RET
          . . 1717:
          . . 1718:// The top-most function running on a goroutine
          . . 1719:// returns to goexit+PCQuantum.
          . . 1720:TEXT runtime·goexit(SB),NOSPLIT,$0-0
          . 45.54s 1721: BYTE $0x90 // NOP
          . 10ms 1722: CALL runtime·goexit1(SB) // does not return
          . . 1723: // traceback from goexit1 must hit code range
of goexit
          . . 1724: BYTE $0x90 // NOP
          . . 1725:
          . . 1726:TEXT runtime·prefetcht0(SB),NOSPLIT,$0-8
          . . 1727: MOVQ addr+0(FP), AX

ROUTINE ======================== runtime.mcall in
/usr/local/go/src/runtime/asm_amd64.s
       30ms 18.25s (flat, cum) 24.03% of Total
          . . 180: MOVQ fn+0(FP), DI
          . . 181:
          . . 182: get_tls(CX)
          . . 183: MOVQ g(CX), AX // save state in g->sched
          . . 184: MOVQ 0(SP), BX // caller's PC
       10ms 10ms 185: MOVQ BX, (g_sched+gobuf_pc)(AX)
       10ms 10ms 186: LEAQ fn+0(FP), BX // caller's SP
          . . 187: MOVQ BX, (g_sched+gobuf_sp)(AX)
          . . 188: MOVQ AX, (g_sched+gobuf_g)(AX)
          . . 189: MOVQ BP, (g_sched+gobuf_bp)(AX)
          . . 190:
          . . 191: // switch to m->g0 & its stack, call fn
          . . 192: MOVQ g(CX), BX
          . . 193: MOVQ g_m(BX), BX
          . . 194: MOVQ m_g0(BX), SI
       10ms 10ms 195: CMPQ SI, AX // if g == m->g0 call badmcall
          . . 196: JNE 3(PC)
          . . 197: MOVQ $runtime·badmcall(SB), AX
          . . 198: JMP AX
          . . 199: MOVQ SI, g(CX) // g = m->g0
          . . 200: MOVQ (g_sched+gobuf_sp)(SI), SP // sp =
m->g0->sched.sp
          . . 201: PUSHQ AX
          . . 202: MOVQ DI, DX
          . . 203: MOVQ 0(DI), DI
          . 18.22s 204: CALL DI
          . . 205: POPQ AX
          . . 206: MOVQ $runtime·badmcall2(SB), AX
          . . 207: JMP AX
          . . 208: RET
          . . 209:

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 14, '16 at 1:34a
activeJan 14, '16 at 1:34a
posts1
users1
websitegolang.org

1 user in discussion

Yulei Xiao: 1 post

People

Translate

site design / logo © 2022 Grokbase