ANTS Profiler

Latest version: 4.3

ANTS Profiler

Notes & articles

Performance profiling with ANTS 4: tips for ANTS 3 users

If you are already familiar with the performance profiling features of ANTS Profiler 3, you may be wondering how to perform the same tasks or find an equivalent feature in ANTS Profiler 4.

ANTS Profiler 4 represents a fundamental change to the performance profiling workflow, so certain performance profiling features from ANTS Profiler 3 are no longer relevant, or are accessed in a different way in ANTS Profiler 4.

This article answers common questions that you may have as an experienced ANTS Profiler 3 user.

Frequently asked questions

How do I ignore application startup activity?

How do I take a snapshot?

How do I disable profiling?

How do I reset the profiler and leave my application running?

How do I compare profiling results?

How do I explore the method hierarchy?

How do I exclude sleeping / blocking time?

How do I change the unit for method execution times?

How do I show the ten slowest lines of code?

How do I show the ten slowest methods?

How do I show the profiling results for a particular thread?

How do I apply a custom filter?

How do I start ANTS Performance Profiler with command-line switches?

How do I ignore application startup activity?

With ANTS Profiler 4, performance profiling is always started automatically when you start your application. You cannot delay profiling until after your application has started as you can in ANTS Profiler 3.

Instead, you can exclude start-up activity from the profiling results by dragging a region on the time line that excludes the start-up period.

See Working with the time line for further details.

Note: ANTS Profiler 4 introduces much less overhead than ANTS Profiler 3. The application you are profiling should run more quickly while using ANTS Profiler 4 as compared to ANTS Profiler 3, reducing the impact of profiling startup activity. For the best profiling performance, set the profiling mode to Method level timings; only methods with source (fastest). (See Setting up and running a profiling session for further details.)

How do I take a snapshot?

ANTS Profiler 4 removes the need for you to take snapshots when performance profiling. Instead, the time line in ANTS Profiler 4 enables you to select any time period during the execution of your application, and immediately display the relevant profiling results.

timelineselection6

The time line displays Windows performance-counter values and event markers, along with execution time. This makes it easy for you to identify interesting points during the execution of your application, select the required time period, and display profiling results.

You can then bookmark any period you selected on the time line, enabling you to compare results from different time periods.

See Working with the time line for further details.

Note: The time line is available only when performance profiling - memory profiling still requires you to take snapshots.

How do I disable profiling?

You cannot disable performance profiling in ANTS Profiler 4 without also stopping the application that is being profiled.

Rather than disabling performance profiling, you can exclude periods of activity from the profiling results by selecting the appropriate region on the time line.

See Working with the time line for further details.

How do I reset the profiler and leave my application running?

With ANTS Profiler 4, you cannot reset the profiler (which discards results that have already been collected) without also stopping the application that is being profiled.

Rather than resetting the profiler, you can exclude periods of activity from the profiling results by dragging a region on the time line that excludes this activity.

See Working with the time line for further details.

How do I compare profiling results?

To jump between profiling results for different time periods within the same profiling session, create bookmarks on the time line, and select a bookmark to display the relevant results set.

See Working with the time line for further details.

To compare profiling results from different profiling sessions, start a second instance of ANTS Profiler 4, and open a previously saved result set. You can then switch between ANTS Profiler 4 instances to compare the profiling results.

How do I explore the method hierarchy?

In ANTS Profiler 4, the call graph shows calling relationships between methods. The call graph performs a similar role to the hierarchy tab in ANTS Profiler 3, but enables you to analyze multiple levels of the hierarchy at once.

The call tree shows calling relationships as individual stack traces traversed during profiling of your application. Rather than focusing on a particular method (like the call graph), the hottest stack traces are displayed first (that is, those sequences of method calls that took the longest time to execute).

See Working with the call graph and Working with the call tree for further details.

How do I exclude sleeping / blocking time?

With ANTS Profiler 4, timing data in performance results can be calculated to exclude the time due to a process sleeping or being blocked. This may give you a more realistic view of where performance problems lie within your code. (It was not possible to exclude sleeping and blocking time from the performance profiling results using ANTS Profiler 3.)

To exclude sleeping and blocking time, ensure that the timing setting in the display toolbar is set to CPU time, rather than Wall-clock time.

calltreedisplayoptions6

This setting applies to the call tree, methods grid, and call graph.

How do I change the unit for method execution times?

In ANTS Profiler 4, method execution times are displayed as percentages by default. To change the unit, on the View menu, click Percentages, Ticks, Milliseconds, or Seconds.

ANTS Profiler 3 displays method execution times in seconds only.

How do I show the ten slowest lines of code?

With ANTS Profiler 4, you cannot directly list the ten slowest lines of code.

However, the source-code pane now includes a "heat map" to the right of the vertical scroll bar.

heatmap

This indicates the position of the slowest lines of code within a particular source file. You can click the bars on the heat map to jump directly to the relevant line of source code, or move your mouse pointer over individual bars to see the line number and timing data for that line.

How do I show the ten slowest methods?

With ANTS Profiler 4, the methods grid enables you to sort methods by Time or Time With Children and see the slowest methods at the top of the grid. There is no Summary pane in ANTS Profiler 4.

See Working with the methods grid for further details.

How do I show the profiling results for a particular thread?

Use the threads list on the display toolbar to choose a specific thread. Only profiling results for the selected thread will be displayed.

threadlist

The threads list also shows separate processes. If the profiling results include any child processes, these are also listed along with their related threads.

You can specify a thread or process to display when viewing the call tree or the methods grid.

How do I apply a custom filter?

ANTS Profiler 3 included custom filters that you could use to specify which classes and methods were profiled during a particular performance profiling session.

ANTS Profiler 4 does not support custom filters. The overhead introduced by ANTS Profiler 4 is considerably lower than the overhead introduced by ANTS Profiler 3, so it is no longer necessary to apply custom filters before starting a profiling session.

With ANTS Profiler 4, to restrict the results displayed in the methods grid after profiling, type a method or class name in the Find box. Results are filtered as soon as you type.

How do I start ANTS Performance Profiler with command-line switches?

There are no command line switches for the ANTS Performance Profiler 4 application.

For memory profiling, the ANTS Memory Profiler 4 application supports command line switches. Click here for further information.

Was this article helpful?

Search support
Forums
Visit the ANTS Profiler forum.

ANTS Profiler

all products