Find Source Code Lines That are Called Most or Least Often

Applies to AQTime 8.81, last modified on January 18, 2022

To determine what lines of your application source code are executed most or least often, you can use the Coverage profiler or the Performance profiler:

  1. Make sure your application was compiled with debug information. See How AQTime Profilers Use Metadata and Debug Information.

  2. Add the routines whose source code lines you want to profile to line-level areas and include these areas in profiling.

  3. Profile your application with the Coverage (or the Performance) profiler and get results.

  4. Select the Routines category in the Explorer panel.

  5. Click the desired routine in the Report panel and switch to the Lines pane of the Details panel. The Hit Count column on this pane tells you how many times each source line was executed.

  6. Sort the results on this pane by the Hit Count column in descending order. The most frequently executed lines will be at the top of the pane, the least frequently executed lines - at the bottom.

It may be more convenient to browse the profiling results together with source code. Switch to the Editor panel and view the hit count value for each source code line in the panel gutter’s Hit Count column. Switch to the Visual Studio Code Editor’s page that contains the application source code and view the hit count value for each source code line in the Hit Count column of the grid which AQTime adds to the Code Editor. Switch to the RAD Studio Editor’s page that contains the application source code and view the hit count value for each source code line in the Hit Count column of the grid which AQTime adds to the Editor.

Note: If the Hit Count column is not visible, right-click within the guttergridgrid, select Field Chooser from the context menu and then drag the column to the guttergridgrid from the consequent Field Chooser window.

See Also

Coverage Profiling
Best Practices and How to Tutorials
Check What Source Code Lines Were Executed
Coverage Profiler - Overview
Performance Profiler - Overview

Highlight search results