简体   繁体   中英

Percentages in CPU profiler in Chrome

What do the percentages in the chrome cpu profiler for the "Heavy (Bottom Up)" view indicate? Specifically I mean in the "Total" column. I had thought percentage of total cpu time (as in total cpu time over the course of the profile recording) but if this is the case then the numbers don't make sense to me since the total amount of cpu percentage time added up is greater than 100 in some cases for me. Does it mean rather the percentage of total cpu time in the function call alone? If so how does that make sense? Or does it possibly indicate only cpu time on a single core and thus having multiple cores will return percentages with a sum greater than 100?

Thanks!

Inclusive times don't add up to 100%, they exceed it, so don't add them up. Suppose you have routine A that calls B, and B that calls C, and so on through D, E, F, and finally to G that actually cranks the CPU for 100% of the time. Then F has 100% inclusive time, and so does E, D, on up to A.

Inclusive time is far more useful to know than self time, 1) because it includes self time, and 2) because the problem could very well be in any one of those routines, not just G.

Therefore it gives you more places to look for speedups, with the result that you find more.

Let's assume that A calls B, B Calls C, and C was executing half of the profiling time. If A and B did nothing but call B and C correspondingly then total time will be 50% for each of A, B and C. It sums up to 150% as you noticed. Self time however is 0% for A and B and 50% for C.

On the second level in the Bottom Up view total time is the total time of the root function when it was on top of the callstack ending at the node on the second level. The same applies recursively to all deeper levels.

This is more complicated for recursive call. See also http://crbug.com/523537 for recent changes in that area.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM