Call Graph

This tutorial demonstrates launching the sample application and using the Call Graph view to identify the parts of the application that consume the most CPU time.

The Call Graph view presents the performance data as a hierarchical graph which can be expanded and collapsed at each node in the graph. This allows you to close parts of the graph that are of no interest, and open parts of the graph that appear more interesting – allowing you to easily identify the parts of the application that consume the most CPU time.

Instrumentation

This tutorial will demonstrate the call graph user interface.

  • Click on the settings icon on the toolbar.
    Settings on toolbar
    The settings dialog is displayed. On the Performance tab, choose the Time Stamp Counter option. Click OK to accept the new settings.
  • Launch the sample application. Click on the relaunch icon on the toolbar to relaunch the most recently launched application.
    Relaunch on toolbar
  • Using the sample application, select the Sort menu and choose Insertion Sort
  • Using the sample application, select the Sort menu and choose Bubble Sort
  • Using the sample application, select the Sort menu and choose Quick Sort
  • Close nativeExample using the File menu Exit command. The application closes. Performance Validator processes any remaining data and displays the final results. 
  • Select the Call Graph tab and set the Sort type to Total Time. Click Refresh. The hotspot display is updated.
    Call graph (collapsed)
  • Click Expand All to expand all the graph roots.
    Call graph (expanded)
  • Select an entry in the graph to display the source code on the right hand side. 
  • Examining the expanded graph you can easily identify which functions are consuming the most CPU time – in the picture above, the nativeExample::bubbleSort() method is responsible for 17.63% of all samples. 

Analysing the call graph.

  • Choose the appropriate way to sort the graph (Average Time) using the Sort combo box and click Refresh
  • Expand the first node and child nodes of the graph. Expand the node corresponding to the Bubble sort. The graph will look something like this:
    Call graph (detail)
  • Expand the two nodes corresponding to the Bubble sort and Quick sort. The graph will look something like this:
    Call graph (expanded detail)
  • It is clear that the Bubble sort function is much slower (almost 3x) than the Quick sort for the test, and thus this area of the application needs further investigation and possibly work to improve its performance.

Fully functional, free for 30 days