Comparing profiling session results

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 function runtimes between the 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

For the Deep Time and Shallow Time columns, the relative and absolute time metrics indicate the increase or decrease from the first (earlier) to the second (later) 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. The insertion sort operation runs faster, as seen by the decrease in deep time for main() (i.e., the whole program) and the small increase in time for this latter sorting function, which is less than the decrease for merge sort. These comparison results reveal that performance has improved with the new sorting method.