Pprof and golang - how to interpret the results?

I am trying to use pprof in my program, however I have somewhat different results from the articles I read (links below). According to my results, I get the following table:

(pprof) top10
1.65s of 1.72s total (95.93%)
Showing top 10 nodes out of 114 (cum >= 0.01s)
      flat  flat%   sum%        cum   cum%
     1.19s 69.19% 69.19%      1.20s 69.77%  syscall.Syscall
     0.16s  9.30% 78.49%      0.16s  9.30%  runtime._ExternalCode

what are these columns flat flat% sum% cum cum%:?

Articles I read: https://software.intel.com/en-us/blogs/2014/05/10/debugging-performance-issues-in-go-programs http://blog.golang.org/profiling - Go programs

+5
source share
2 answers

, , GopherCon; , Uber pprof.

Go Programs .

0

, foo, 3 .

func foo(){
    a()                                 step1
    b()                                 step2
    do something directly.              step3
    c()                                 step4
}

, foo, 6 , .

func foo(){
    a()                                 // step1 takes 1s
    b()                                 // step2 takes 1s
    do something directly.              // step3 takes 3s
    c()                                 // step4 takes 1s
}
  • flat , 3.
  • cum foo, . ( = step1+ step2 + step3+ step4)

%

top pprof, , . Sum% , / .

, , . sum% 45,17%. :

line1 19.33%
line2 13.27%
line3 6.60%
line4 5.97%
-----------
sum% 45.17%

enter image description here

%

sum% . .

, 91,06% . , . .

enter image description here

Reddit: "" "" golang pprof

0

Source: https://habr.com/ru/post/1607323/


All Articles