Annotated source editor

The annotated source editor lets you see the amount of time your program spends on each line of code and in each function.

Your application binary must have debug information and your host system must have the source file for a given function for you to see its execution time data in the editor.

To see execution time data for a function:

  1. In the Profiler Sessions view, select the profiling session of interest.
  2. In the Execution Time view, find the function of interest in the function table or threads tree, then double-click its row or right-click it and choose Show Source.

    The IDE opens the corresponding source file in the annotated source editor:

You may see incorrect profiling data if you changed your source after compiling it because the editor relies on the line information provided by the binary that was profiled.
The annotated source editor shows a solid or graduated bar graph on the left side. The length of the bar represents the percentage of total execution time. The color represents details specific to the function or single line, as follows:
For the first line of a function, a blue-yellow bar shows its total runtime. This includes the function's shallow time, the sum of its children's deep times, and all time in which the thread wasn't running while blocked inside of it.
For a line of code, a green bar shows the amount of time for the inline sampling or call-pair data. The lengths of the green bars within a function add up to the length of the blue-yellow bar on its first line.

To view quantitative profiling data, hover the pointer over a colored bar. The resulting tooltip shows the total number of milliseconds and total percentage of execution time for that code. For children, the tooltip shows the percentage of time relative to the parent.