ANTS Performance Profiler
Latest version: 7.4
Learning topics
Choosing a profiling mode in ANTS Performance Profiler 6 and 7
ANTS Performance Profiler offers up to five profiling modes. This technical paper discusses their uses and the differences between them.
The five profiling modes are:
- Sample method-level timings (fastest, least detail, no hit counts)
- Method-level timings; only methods with source (very fast, most accurate)*
- Line-level and method-level timings; only methods with source (detailed)*
- Method-level timings; all methods (faster)*
- Line-level and method-level timings; all methods (most detailed)
(The profiling modes marked with an asterisk (*) in the list above are only available in ANTS Performance Profiler Professional.)
Each profiling mode involves a different amount of trade-off between the performance overhead introduced into your application (speed), the accuracy of the results provided and the amount of detail in the results.
The table below provides an overview of each profiling mode:
Profiling mode |
Profiling type |
Profiles individual lines of code? |
Includes methods without source code? |
Performance overhead added |
SQL/ HTTP profiling (Pro only) |
Accuracy |
Detail |
Line-level and method-level timings; all methods |
Instrumented |
Yes |
Yes |
|
Yes |
|
|
Method-level timings; all methods |
Instrumented |
No |
Yes |
|
Yes |
|
|
Line-level and method-level timings; only methods with source |
Instrumented |
Yes |
No |
| Yes |
|
|
Method-level timings; only methods with source |
Instrumented |
No |
No |
|
Yes |
|
|
Sample method-level timings |
Sampled |
No |
No |
|
No |
|
|
Sample method-level timings
In this mode, the profiler samples only the performance of your application. It introduces the least overhead but the results are not detailed. Because the mode uses sampling, ANTS Performance Profiler cannot count the number of times each method is hit.
Use sample method-level timings first if you have a complex application (a lot of different methods) which you need to run for a long time so that you can find out where the performance problem is. After you have identified the particular behavior which causes the problem, use one of the other modes to obtain detailed results.
Method-level timings; only methods with source
In this mode, the profiler profiles only methods that you have source code for, or methods from code decompiled using Red Gate's .NET Reflector VSPro edition. It records how many times each of these methods is hit but not how long it takes to execute each line within the methods. For this reason, it is faster than most other modes. This mode does not add much performance overhead to your application, and so the method-level timings are the most accurate.
Use method-level timings if you are certain that the performance problem is in one of your methods (or another method you have source code for) and if obtaining accurate timings is important to help you find the problem.
Line-level and method-level timings; only methods with source
This mode is the same as method-level timings; only methods with source, except that the profiler also records how long it takes each line of code within each method to execute. The advantage is that this mode can help you to identify exactly which line of code is causing the performance problem.
The disadvantage is that this mode reduces the performance of your application, causing it to run slower. This also means that the timings collected will be less accurate because by default the profiler estimates the overhead which it is adding to your application, and subtracts this from the recorded timings. For some very simple functions, this might mean that you see negative timings. (The estimate is most accurate for functions taking at least 1000 clock cycles.)
Method-level timings; all methods
This mode is the same as method-level timings; only methods with source except that all methods are included, even if you do not have source code for them. This mode is faster than the modes which include line-level timings but it is slightly slower than only profiling methods for which you have source code.
Use this mode if you are not sure whether the performance problem is caused by your code or some third-party code which you do not have source code for. This mode will also record timings for the .NET Framework's own methods.
Line-level and method-level timings; all methods
This mode records profiling results for every line of code in your application, even if you do not have source code for them. It gives you the most detail but it introduces a lot of overhead into your application and so the timings will not be accurate for the reasons described under line-level and method-level timings; only methods with source).
Was this article helpful?
ANTS Performance Profiler
- Installation error 5100 when installing ANTS Performance Profiler and ANTS Memory Profiler
- Attach to process unavailable with some anti-virus software
- Memory leaks observed when profiling Windows Presentation Framework (WPF) applications
- Log files
- The manifest for the SQL server event source did not match the generated events. Some SQL events may report incorrect data. To fix this issue, consider recompiling etwcls.mof
- Setting file I/O and child process profiling in high DPI modes
- HTTP request timings in IIS
- Profiling web services in IIS Express
- Method not found: 'UInt32 <Module>._ANTS_Begin_Sql(System.String)'
- Enabling line-level timings for SecurityTransparent code
- Profiling SharePoint 2010 in v6.0 - 6.3
- Profiling SharePoint subsites
- Problems synchronizing results
- Windows service profiling fails if the service uses a system account
- Profiling assemblies protected with DeployLx
- The type initializer for 'y.layout.hierarchic.ClassicLayerSequencer' threw an exception
- Forcing your application to use .NET 4
- Double hit counts occurring on one line
- System.EntryPointNotFoundException (Versions: 3,4 only)
- Methods in (ASCX) web controls may not appear
- Failed to CoCreate Profiler error profiling a Windows service
- Multiple-core portable computers may show inflated times (version 3)
- No .NET methods were profiled on web application
- ANTS Profiler code instrumentation method
- Add-in fails to load when using RunAs to start Visual Studio as another user
- Profiling unit tests using Nunit
- Can I profile Compact Framework applications?
- Profiling a SharePoint 2007 Web Part
- Profiling an assembly in the Global Assembly Cache (GAC)
- Profiling IIS web applications that need to run under the SYSTEM account
- Profiling a web application hosted in IIS on a fixed TCP port
- Profiling client-side XBAP .NET applications
- ANTS Profiler prompts for location of source code which is not your own source code
- ANTS menu remains in Visual Studio after uninstall of ANTS Profiler
- Profiling a web application needing to run as the Network Service account
- Cannot start COM+ application via Remote Desktop
- Finding the overall time taken to execute a thread
- Profiling BizTalk applications
- Profiling Microsoft Office managed-code add-ins
- The system cannot find the file specified
- Error Stopping IISAdmin profiling IIS web application on Windows XP
- Creating a global debugging symbols (PDB) directory
- Using the add-in to profile solutions containing more than one project
- Methods may be missing on multi-core systems in version 3
- ASP .NET 1.x application recycling causing incomplete results
- Application recycling causes incomplete results and other errors when profiling ASP .NET
- (version 5) Support for profiling Silverlight applications
- Couldn't open metabase error when profiling ASP .NET hosted in IIS
- Failed to coCreate Profiler on ASP .NET web application
- HTTP error 404.17 profiling ASP .NET 1.1 on IIS 7
- Performance counters missing from results
- Isolating single ASP .NET pages in ANTS Profiler results
- Missing hits for lines in the source code view
- ANTS Profiler restarts IIS
- Showing the amount of time taken for a method in one particular thread
- Please specify a valid URL message profiling ASP .NET
- Times on individual lines do not add up to method time
- Explanation of "thread blocked" methods in ANTS Profiler
- Call graph percentages do not add up exactly
- Operation could destabilize the runtime error profiling ASP .NET
- IIS ceases to work after profiling web applications
- Problems with ANTS Visual Studio integration
- ANTS Profiler has been split into two distinct programs
- Windows Installer errors 1603 and 2738 occurring during installation
- Times in source code window are greater than the times showing in the method grid or tree view
- Problems with ANTS Performance Profiler Visual Studio integration
- Profiling ClickOnce applications deployed to IIS
- Could not enable tracing due to error code 112
- AjaxControlToolkit incompatibility causing application being profiled to crash
- Could not enable tracing because SQL Express is installed
- ANTS Performance Profiler menu items not showing in Visual Studio 2010
- Profiler stopping while profiling an in-browser Silverlight application
- "No Disk" error occurring while profiling application
- IE error "Internet Explorer cannot display the webpage" when profiling a website
- Profiler failing to connect to the server when profiling web applications
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
ANTS Performance Profiler
- Activating your products
- Activating your products
- Interpreting unexpected profiling results
- Choosing a profiling mode in ANTS Performance Profiler 6
- ANTS Performance Profiler 7 release notes - version 7.xx
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs
ANTS Performance Profiler
- Worked example: Profiling an ASP.NET application - ANTS Performance Profiler
- Worked example: Profiling from the command line - ANTS Performance Profiler
- Worked example: Profiling performance of an algorithm - ANTS Performance Profiler
- Worked example: Profiling network overheads - ANTS Performance Profiler

Using ANTS Performance Profiler