Unused VCL Units Profiler Tutorial: 2 - Analyzing the Profiling Results

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

The Summary panel provides general statistics about the total number of analyzed units and the number of unused units, for instance:

Profiling results in the Summary panel

Click the image to enlarge it.

Profiling results in the Summary panel

Click the image to enlarge it.

Profiling results in the Summary panel

Click the image to enlarge it.

Further information on each of the profiled unit is displayed in the Report and Details panels. The Report panel lists all of the units that the profiled application includes. The units that were considered as “not used” are listed in the Unused column.

Profiling results in the Report panel

Click the image to enlarge it.

Profiling results in the Report panel

Click the image to enlarge it.

Profiling results in the Report panel

Click the image to enlarge it.

The profiler can mistakenly consider certain units (those that hold constants, variables, class type declarations, classes with only inherited methods) as not used while they are actually used. (See, the Recognition Issues section in the Unused VCL Units Profiler - Overview for details.) To avoid this, you can add the names of such “problematic” units to the <AQTime>\Bin\Extensions\IgnoredUnits.txt file, or specify unit names or their parts in the Ignore units with names containing option.

A unit can be imported either by a unit of your application (direct importing) or by some standard unit (indirect importing). To determine how the current unit was imported, check the value of the Importing User Units column. If its value is zero, then the unit is imported indirectly, otherwise, the unit name is explicitly listed in the uses section of your application units and the column’s value shows how many user units refer to the selected unit. Units imported directly (those that have non-zero column values) are a subject of primary interest to us. Removing references to them from our code will also reduce the number of indirectly imported units.

As you can see in the image above, the profiled application has five unused units and the, Classes and UnusedUnit, are referred from the application’s code (they have non-zero values in the Importing User Units column). The Classes unit is referred to by one unit and the UnusedUnit is referred from two units.

To find out which units the selected unit is imported from, double-click the desired unit in the Report panel and look at the unit list in the Details panel (see the image above). In our case, the Classes unit is imported by the UnusedVCLUnitsDemo unit while UnusedUnit is imported by the MainUnit and UnusedVCLUnitsDemo units.

In the next step, we will describe how to remove unused units from the application.

Prev     Next

See Also

Unused VCL Units Profiler

Highlight search results