Usage of profilers and how to utilize the results

How can we profile our C++ code. We are using the Visual Studio 2017 profiler. How can we describe the results of "Total CPU" and "Self CPU"?
We ahve created a function with quite high "Self CPU". The value of "Self CPU" is equals to "Total CPU" for this function. What is the meaning of this statement?
What is the next steps to find the performance bottle necks in the specific funtion?
Please help.
Thanks in advance.


  • In general total CPU indicates the total time spent in the function. While self-CPU, excludes the time spent in other function that may be called.
    Assume you have a function f() that calls 2 other funcs g() and h().
    void f(){
    You would have total-CPU(f)=self-CPU(f)+total-CPU(g)+total-CPU(h) (if g and h are not used in other places of the program).
    And if there is no function call in f, total-CPU(f)=self-CPU(f)
    In your specific case, if you have a function with a high self-CPU and total-CPU==self-CPU, this probably means that this function is one of your bottlenecks.

Sign In or Register to comment.