ANTS Performance Profiler 10

Saving profiling results

You can save the results of a profiling session in different ways:

  • Save Session Settings lets you save all the settings of the current profiler session for use in a future profiling session

  • Save Profiler Results lets you save the results of your profiling session (including the timeline, call tree and all other profiling results views) for future analysis in the ANTS Performance Profiler user interface

  • Export lets you export the current profiling results view as an HTML, XML or CSV file

Save Session Settings was called 'Save Project' in previous versions.


Saving session settings

To save the settings you used to profile your application, on the File menu, click Save Session Settings

Session settings files have the file extension .app8

To load a saved session settings file, on the File menu, click Open Session Settings... The settings screen will be shown, with the settings from your saved session already selected.

ANTS Performance Profiler displays your recent profiling sessions and settings on the startup screen, so you don't need to save the settings every time you want to use reuse the same settings. You may only need to save settings if you regularly run several different profiling sessions.

You can load saved 'projects' from previous versions of ANTS Performance Profiler in the current version.

Saving profiler results 

To save the current profiler results, on the File menu, click Save Profiler Results... All profiling results will be saved for the entire time period you profiled, not just the selected region of the timeline.

Profiling results files have the extension .app8results

To load saved results, on the File menu, click Open Profiler Results... The profiling results from your saved session are shown. You can interact with the ANTS Performance Profiler results view as if you had just profiled your application.

You can load saved results from previous versions of ANTS Performance Profiler in the current version.

Opening large results files may take several minutes, during which the UI may appear to freeze. We hope to show progress in a future version of the profiler.


Exporting results to an HTML, XML or CSV file

To export the current profiling results view, on the File menu, click Export, then select the type of file you want to export your results to.

When you export your results, any filters you have applied will not be saved.

If Async mode is enabled in the call tree, results will be saved as if Async mode was disabled. For more information about Async mode, see Async in the call tree.

CSV format is not available for the call tree and call graph view when profiling in the ANTS Performance Profiler user interface. Call tree results can be exported to CSV format when profiling from the command line. For more information about profiling from the command line, see Profiling from the command line (API).

Here's an example of the call tree from profiling a Mandelbrot application that we will use to illustrate the format of XML and CSV results files. This is the call tree results view with CPU time selected (i.e. excluding time elapsed while a thread was blocked)

This is the call tree results view with Wall-clock time selected (i.e. showing total time elapsed, including blocking):

After exporting to an XML file, the Mandelbrot.Form1.DrawMandelbrot() method looks like this in XML format:

 <Method class="Mandelbrot.Form1" name="DrawMandelbrot" PID="7728" has-source="yes">
   <HitCount>3</HitCount>
   <CPU ticks="3893693658" millisecs="1298.0397" percent="28.912" />
   <Wallclock ticks="3893772648" millisecs="1298.0660" percent="4.612" />
   <WithSelf ticks="168573329" millisecs="56.1907" percent-cpu="0.719" percent-wallclock="0.115" />
</Method>

If the application is profiled from the command line, the call tree can also be exported in CSV format (with headings row). The Mandelbrot.Form1.DrawMandelbrot() method looks like this in CSV format:

Method type, Class, Method, Hit count, CPU %, CPU milliseconds, CPU ticks, Wallclock %, Wallclock milliseconds, Wallclock ticks, CPU % time with self, Wallclock % time with self, Milliseconds with self, Ticks with self
, Mandelbrot.Form1,DrawMandelbrot(), 3, 28.9128149753427, 1298.039706707, 3893693658, 4.6121681679019, 1298.06604003906, 3893772648, 0.71996638783019, 0.115110266291296, 56.1907373464783, 168573329

Spaces have been added between each field to ensure that the lines in this example CSV file wrap.

Exporting event markers to an XML or CSV file

ANTS Performance Profiler saves details about various events occurring within your application, such as exceptions, activating or closing a WinForm window, clicking on a WinForm element, thread-related events and even custom events you can invoke from your code.

In a desktop application those events are displayed under the timeline using colored markers.

Starting with version 10.1.9 of the ANTS Performance Profiler you can export all events to an XML or CSV file using command line.

Profile.exe /e:APP_EventsTest.exe /ll /ecsv:events.csv /exml:events.xml

The command above will run APP_EventsTest.exe application using Line Level profiling, and export events to events.csv and events.xml files. To learn more about command line profiling see Profiling from the command line (API).

After exporting to an XML file, events will look like this in XML format:

<?xml version="1.0" encoding="utf-8"?>
<EventData>
    ...
    <Events>
        <Event ElapsedTimeMs="78.6805231787057" ThreadId="9500" EventType="ThreadAssigned" EventTypeDescription="Managed thread assigned to OS thread" ThreadManagedId="1" ThreadOSID="9500" />
        <Event ElapsedTimeMs="79.1099475557227" ThreadId="4144" EventType="ThreadAssigned" EventTypeDescription="Managed thread assigned to OS thread" ThreadManagedId="2" ThreadOSID="4144" />
        <Event ElapsedTimeMs="455.550159963599" ThreadId="9500" EventType="ExceptionThrown" EventTypeDescription="Exception" ExceptionType="System.Exception" Message="This exception should be captured by APP" />
        <Event ElapsedTimeMs="2456.65525409974" ThreadId="9500" EventType="ExceptionThrown" EventTypeDescription="Exception" ExceptionType="System.Exception" Message="So is this" />
        <Event ElapsedTimeMs="4463.25764572938" ThreadId="9500" EventType="ThreadNamed" EventTypeDescription="Thread named" ThreadManagedId="3" ThreadName="test thread" />
        <Event ElapsedTimeMs="4466.78245507005" ThreadId="12196" EventType="ThreadAssigned" EventTypeDescription="Managed thread assigned to OS thread" ThreadManagedId="3" ThreadOSID="12196" />
        <Event ElapsedTimeMs="4481.78624108127" ThreadId="12196" EventType="ThreadDestroyed" EventTypeDescription="Thread destroyed" ThreadManagedId="3" />
        <Event ElapsedTimeMs="6477.97679612976" ThreadId="9500" EventType="Generic" EventTypeDescription="User event" Message="This is a user event" />
    </Events>
</EventData>

The same events will look like this in CSV format:

ElapsedTimeMs,ThreadId,EventType,EventTypeDescription,ExceptionType,Message,ThreadManagedId,ThreadOSID,ThreadName,AdditionalData
78.6805231787057,9500,ThreadAssigned,Managed thread assigned to OS thread,,,1,9500,,
79.1099475557227,4144,ThreadAssigned,Managed thread assigned to OS thread,,,2,4144,,
455.550159963599,9500,ExceptionThrown,Exception,System.Exception,This exception should be captured by APP,,,,
2456.65525409974,9500,ExceptionThrown,Exception,System.Exception,So is this,,,,
4463.25764572938,9500,ThreadNamed,Thread named,,,3,,test thread,
4466.78245507005,12196,ThreadAssigned,Managed thread assigned to OS thread,,,3,12196,,
4481.78624108127,12196,ThreadDestroyed,Thread destroyed,,,3,,,
6477.97679612976,9500,Generic,User event,,This is a user event,,,,

Didn't find what you were looking for?