ANTS Performance Profiler - 5.2

ANTS Performance Profiler

Learning ANTS Performance Profiler - 5.2

Working with the call tree

The call tree shows the stack traces that were executed by your application during the time period you have selected. By default, stack traces are displayed top-down (calling method above called method). The "hottest" stack trace (the one that took the most time to run) is displayed at the top of the call tree, and is automatically expanded. If a method was called in several contexts, it is displayed once for each context in the call tree.

See Tips on using the call tree for more information on how to use the call tree effectively.

calltree2

The following data is shown for each method within the stack trace, for the selected time period:

  • Time: the total execution time for the method within this stack trace.
  • Time With Children: the total execution time for the method and all its children within this stack trace.
  • Hit Count: the number of times the method was called within this stack trace.

Each method is shown with one of the following icons:

calltreeleafsymbol

Root method or leaf method. Root methods are not called by any other method; leaf methods do not call any other method.

calltreetopdownarrow

Indicates call flow when the call-tree direction is top-down (calling method above called method).

calltreebottomuparrow

Indicates call flow when the call-tree direction is bottom-up (called method above calling method).

hoticon

Method is part of the hottest (longest running) stack trace. Used instead of the root/leaf or call-flow icons.

Methods listed in bold have source code available. To display the method's source code, click any bold method. Line-level timings are also available in the source-code pane if you use one of the Line-level ... profiling modes.

You may also see the following items in the call tree. These are shown in bold orange text, and represent time spent in your application that is in addition to time spent executing specific methods:

  • Thread blocked: The executing thread was blocked. For example, the thread may have been sleeping, waiting for access to a shared resource, or waiting for I/O. Thread blocked items only contribute to timings in the call tree when the Timing display option is set to Wall-clock time. To exclude time due to Thread blocked items, select CPU time from the Timing display option. The call-tree display options are described below.
  • Transition to unmanaged code: A transition from managed code to unmanaged code occurred at this point in the stack trace. In general, line-level and method-level timings are not available for the unmanaged code. However, for unmanaged methods that are declared with extern within managed code, method-level timings are available.
  • Transition to managed code: A transition from unmanaged code to managed code occurred at this point in the stack trace.
  • JIT overhead: JIT compilation occurred at this point in the stack trace during execution of your application. The method that needed to perform the compilation is shown as the parent of a JIT overhead item.
  • Profiler overhead: Additional overhead introduced by ANTS Performance Profiler. This is unlikely to be seen when the option to adjust timings to compensate for overhead added by the profiler is enabled.
  • Assembly load or unload: A .NET assembly was loaded or unloaded.
  • Module load or unload: A .NET module was loaded or unloaded.

To create a new call graph based on a particular method, select the method in the call tree, and click the new call graph button newcallgraph in the Method column.

Changing the call-tree display options

You can change the way data is displayed in the call tree, using the display options on the results toolbar:

methodsgriddisplayoptions2.gif

  • Direction and scope: controls whether the call tree is displayed top-down (calling methods above called methods) or bottom-up (called methods above calling methods), and also whether any method, or only methods with source, are shown. If you choose an option that shows any method, the call tree will include details for .NET Framework class-library methods.
  • Threads: filters the display of stack traces by thread.
  • Timing: controls the way in which method timings are calculated. You can choose from Wall-clock time which includes blocking such as waiting for I/O, or CPU time which excludes blocking.
  • Hide insignificant methods: select this check box to hide methods that contribute less than 1% of the total execution time for the currently selected time period.

You can also:

  • Change the time unit. On the View menu, click Percentages, Ticks, Milliseconds, or Seconds.
  • Reorder the call tree. To change the stack-trace order, click the Time With Children (%) column heading.

Tips on using the call tree

To locate methods that may be good candidates for optimization:

  1. Order the call tree with the slowest stack traces at the top (top-down). If necessary, click the Time With Children column heading to change the stack-trace order.
  2. Starting with the slowest stack traces, look for method pairs where subsequent values for Time With Children reduce substantially as you move down the stack trace. Methods with higher values in such pairs may be good candidates for optimization.

    ANTS Performance Profiler can optionally suggest methods that may be good candidates for optimization. To show suggested methods, on the Tools menu, click Suggest methods to optimize. Suggested method names are marked with an asterisk (*).

    In general, the better you understand the structure and meaning of your code, the more easily you will be able to interpret the data collected by the profiler.

To reduce the number of methods shown, you can do any of the following:

  • Choose a "(methods with source)" option from the Direction and scope list in the display options.

    calltreedisplayoptions6

  • Select the Hide insignificant methods check box in the display options.
  • Select a shorter region on the timeline.

To find a particular method:

  1. On the Tools menu, click Find.

    The Find bar is displayed beneath the call tree.

  2. Type all or part of the method name you are looking for, and press ENTER.

    The first matching row in the call tree is highlighted.

Click previousarrow Previous or nextarrow Next to move between matching method names.

See also

Working with the timeline

Working with the methods grid

Working with the call graph

Working with source code

Was this article helpful?

Search support
Forums

ANTS Performance Profiler

all products