Line Timing

This tutorial demonstrates launching the sample application and using the Line Timing view to identify the parts of an algorithm that consume the most time.

  • Click on the settings icon on the toolbar.
    Performance Validator settings icon
    The settings dialog is displayed. On the Performance tab, choose the Time Stamp Counter option. This option causes Performance Validator to instrument your application and to time various operations using the processor’s time stamp counter. If you do not want to use the time stamp counter you can choose one of the other instrumentation options. Click OK to accept the new settings.Note: You cannot perform line timing when in sampling mode, you must choose one of the instrumentation modes.
  • Switch to dialog mode. On the Configure menu, choose User Interface Mode….
    Performance Validator settings menu
  • The User Interface mode dialog is displayed. Choose Dialog and click OK to accept the choice.
    Performance Validator user interface dialog
  • Click the launch button.
    Performance Validator launch icon toolbar
  • The dialog mode launch dialog is displayed.
    Performance Validator line timing option on launch dialog
  • Select the Collect line times check box. Choose the nativeExample.exe entry in this history list and click the Go button. The application is launched.
  • Using the sample application, select the Sort menu and choose Quick Sort.
  • Using the sample application, select the Sort menu and choose Comb Sort.
  • Using the sample application, select the Sort menu and choose Heap Sort.
  • Using the sample application, select the Sort menu and choose Merge Sort.
  • Using the sample application, select the Sort menu and choose Bubble Sort.
  • Close nativeExample.exe using the File menu Exit command. The application closes. Performance Validator processes any remaining data and displays the final results.
  • Select the Line Timing tab and click Refresh. The display will look similar to the image below.
    Performance Validator line timing profiling statistics
  • The display can be sorted by clicking on a column heading. Selecting an entry displays the source code in the right hand window. Expanding an entry displays the individual visit counts and line times for each line.

Analysing the line timings.

We already know from the other tutorials that Bubble sort is slower than Quick sort. Examining the individual line times shows why this is the case. Entries showing statistics of —- indicate that this line could not be hooked by Performance Validator and that statistics are not available for the line.

Bubble sort

The statistics for the bubble sort are:
Performance Validator bubble sort line timing statistics

These statistics are also displayed embedded with the source code:
Performance Validator line timing bubble sort source code

Quick sort

The statistics for the Quick sort are:
Performance Validator quicksort line timing profiling statistics

These statistics are also displayed embedded with the source code:
Performance Validator line timing quicksort source code

Fully functional, free for 30 days