Comparing profiling session results

Updated: April 19, 2023

Typically, profiling is part of an iterative development process in which you make changes to improve efficiency in some application areas based on the latest performance results. The IDE supports this process by letting you easily compare the results of two Application Profiler sessions.

The comparison feature works for both profiling methods—that is, when sampling positions and counting calls or when measuring function runtimes. It's not recommended to compare sessions that used different methods because sampling-based estimates are less precise than function measurements.

Also, a comparison is meaningful only when you profiled the same application with the same workflow but different implementations, based on code changes you made to improve performance.

To compare the results of profiling sessions:
  1. In the Analysis Sessions view, use multiselect to highlight two Application Profiler sessions.
    The comparison feature works only when exactly two sessions are selected.
  2. Right-click and in the context menu, choose Compare.
In the Execution Time view, the IDE displays the differences in the results from two sessions. The functions table, which you can select by clicking the Show Table button (Icon: Show Table) in the upper right corner, is best for seeing these differences:

Screenshot of Execution Time view showing comparison of two profiling sessions

Full details about the numbers and icons shown in the comparison results are given in the Application Profiler reference. In summary, the Deep Time and Shallow Time values indicate the increase or decrease in execution time from the first (older) to the second (newer) session. In the program used to generate the results shown above, the shuffle() function calls mergeSort() during the first session but insertionSort() during the second session. This latter operation runs faster, as seen by the decrease in deep time for main() (i.e., the whole program) and the time for the insertion sorting function being less than that for merge sorting. Thus, performance has improved with the new sorting method.