ANTS Performance Profiler 7

Working with integrated decompilation

ANTS Performance Profiler lets you decompile methods without source directly from the call tree. Decompiling a method generates line-level code from any .NET assembly. This allows you to identify the causes of performance problems in previously inaccessible code – for example, third-party components or legacy assemblies called by your application.

Integrated decompilation is powered by .NET Reflector; however, you do not need to have .NET Reflector installed to use integrated decompilation.

To decompile a method from an assembly with no PDB in ANTS Performance Profiler 7.2 and later:

  1. In the Results toolbar, directly above the call tree, select All methods to view methods without source.

  2. In the call tree, select a method without source code (shown in the call tree in plain, unbolded text).

  3. Select Decompile to generate source code for the selected method.
    ANTS Performance Profiler now decompiles the selected method, and displays automatically-generated source code for the selected method in the source-code pane. Without a PDB file, line-level timings are unavailable, but method-level timings are shown.
    For more information on navigating your decompiled source, see Working with source code.

To decompile a method from an assembly with no PDB in ANTS Performance Profiler 7.0:

  1. In the Tree View Display Options menu, directly above the call tree, select Top-down (any method) to view methods without source.

  2. In the call tree, select a method without source code (shown in the call tree in plain, unbolded text).

  3. Select Decompile to generate source code for the selected method.
    ANTS Performance Profiler now decompiles the selected method, and displays automatically-generated source code for the selected method in the source-code pane. Without a PDB file, line-level timings are unavailable, but method-level timings are shown.
    For more information on navigating your decompiled source, see Working with source code.

To decompile a method from an assembly with a PDB:

  1. In the call tree, select a method from an assembly for which you have a PDB but no source code (shown in the call tree in plain, unbolded text).
  2. Click Decompile to generate source code for the entire assembly.
    ANTS Performance Profiler now decompiles the selected assembly or method, and displays automatically-generated source code for the selected method in the source-code pane. If you chose a profiling mode with line-level timings, ANTS Performance Profiler will match these timings to the decompiled code, though the timings may be inexact.
    For more information on navigating your decompiled source, see Working with source code.

Methods will also display without source if you have the assembly's source code but ANTS Performance Profiler cannot automatically locate it. To manually specify a path to the source code for an assembly, select Locate source.

Decompiling Silverlight applications

Code from Silverlight browser applications embedded using Javascript cannot be decompiled.

Silverlight browser applications embedded using HTML can be decompiled if ANTS Performance Profiler can locate the associated XAP file. For information on configuring your Silverlight application so that ANTS Performance Profiler can find the XAP file, see How to: Add Silverlight to a Web Page by using HTML (MSDN).

If ANTS Performance Profiler cannot find the XAP file automatically, the message "Could not identify a file path" will be displayed.

To manually specify the path to the XAP file, on the Application Settings dialog, perform the following steps:

  1. Under Choose application type to profile, click Silverlight 4+ application.
  2. In the Silverlight application URL field, enter the path to the XAP file (rather than to the website).

Code from Silverlight out-of-browser applications can also be decompiled if the profiled application is configured to work as an out-of-browser application.

Decompiling obfuscated code

Some obfuscated code cannot be decompiled, or can be decompiled only partially. Partially obfuscated code, when decompiled, may display mangled method names and absent lines of code.

If an obfuscated method cannot be decompiled, the method's contents are replaced with the comment "This code is obfuscated and can not be translated" in the source code pane.

Saving profiling results

When saving profiling results, any decompiled code generated during the profiling session is not saved. On opening a saved session, to view source for methods from third-party assemblies, follow the decompilation steps above.


Didn't find what you were looking for?