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!
答案 0 :(得分:1)
包容时间不超过100%,超过它,所以不要加起来。假设您有一个调用B的例程A和一个调用C的B,依此类推D,E,F,最后是G,它实际上是在100%的时间内启动CPU。那么F具有100%包含时间,E,D也是如此,直到A。
包容时间比自我时间更有用,1)因为它包括自我时间,2)因为问题很可能出现在任何一个例程中,而不仅仅是G.
因此,它为您提供了更多寻找加速的地方,结果您可以找到更多。
答案 1 :(得分:0)
假设A调用B,B调用C,C执行分析时间的一半。如果A和B没有做任何事情,只能相应地调用B和C,那么对于A,B和C中的每一个,总时间将为50%。如您所注意到的那样,它总计达到150%。然而,A和B的自身时间为0%,C为50%。
在Bottom Up视图的第二级,总时间是 root 函数在第二级节点上结束的callstack顶部时的总时间。这同样适用于所有更深层次的。
这对于递归调用来说更复杂。有关该领域的最新变化,另请参阅http://crbug.com/523537。