373

What profilers have you used when working with .net programs, and which would you particularly recommend?

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
ricree
  • 35,626
  • 13
  • 36
  • 27

30 Answers30

284

I have used JetBrains dotTrace and Redgate ANTS extensively. They are fairly similar in features and price. They both offer useful performance profiling and quite basic memory profiling.

dotTrace integrates with Resharper, which is really convenient, as you can profile the performance of a unit test with one click from the IDE. However, dotTrace often seems to give spurious results (e.g. saying that a method took several years to run)

I prefer the way that ANTS presents the profiling results. It shows you the source code and to the left of each line tells you how long it took to run. dotTrace just has a tree view.

EQATEC profiler is quite basic and requires you to compile special instrumented versions of your assemblies which can then be run in the EQATEC profiler. It is, however, free.

Overall I prefer ANTS for performance profiling, although if you use Resharper then the integration of dotTrace is a killer feature and means it beats ANTS in usability.

The free Microsoft CLR Profiler (.Net framework 2.0 / .Net Framework 4.0) is all you need for .NET memory profiling.

2011 Update:

The Scitech memory profiler has quite a basic UI but lots of useful information, including some information on unmanaged memory which dotTrace and ANTS lack - you might find it useful if you are doing COM interop, but I have yet to find any profiler that makes COM memory issues easy to diagnose - you usually have to break out windbg.exe.

The ANTS profiler has come on in leaps and bounds in the last few years, and its memory profiler has some truly useful features which now pushed it ahead of dotTrace as a package in my estimation. I'm lucky enough to have licenses for both, but if you are going to buy one .Net profiler for both performance and memory, make it ANTS.

Edward Wilde
  • 25,967
  • 8
  • 55
  • 64
Matt Howells
  • 40,310
  • 20
  • 83
  • 102
  • 5
    The profiler in Visual Studio is also really easy to use, Visual Studio 2010 is in Beta and hence is free also. There have been multiple enhancements in 2010 for viewing contention and concurrency. try it... – Rick Sep 25 '09 at 03:19
  • 15
    @Rick Unfortunately the profiler of Visual Studio is not present in Professional Edition... – Drake Oct 26 '09 at 09:58
  • I strongly disagree about the CLR profiler being all you need for .NET memory profiling, although it's possibly true if you place no value on your time. See my answer below for a summary of the best couple of memory profilers - they *will* help you find memory leaks and potential issues much faster. – Ben Robbins Jan 13 '10 at 01:01
  • 1
    Current releases of the EQUATEC profiler are not free anymore. – David Schmitt Feb 08 '10 at 13:14
  • 1
    Seems like EQATEC Profiler has become free for .NET (full framework) again – soren.enemaerke Aug 17 '10 at 19:46
  • EQATEC Profiler is free for **all platforms** now with some DLL-limit restrictions: desktop, CF, Silverlight, and WP7. It's still the only profiler to support all .NET 2.0+ platforms. – Richard Flamsholt Dec 02 '10 at 15:01
  • Be careful to read the license terms. DotTrace is extremely restrictive regarding transfer of license keys among developers. – scobi Jun 28 '11 at 22:21
  • The CLR Profiler linked is the old version- the new one is [here](http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=13382) – arolson101 Nov 04 '11 at 13:56
  • I've had excellent results with the latest version of the CLR Profiler. It's free, it comes with source, and most importantly, it gave me all I needed. It might not have the polish of commercial projects, but it had more than enough detail for me. – Roman Starkov Nov 20 '11 at 15:36
  • I use dotTrace with dotMemory (a separate app from JetBrains) and have found them to always deliver what I need. No experience with the others so I can't speak to how good it is in comparison. – David Thielen Jul 04 '12 at 18:21
88

Others have covered performance profiling, but with regards to memory profiling I'm currently evaluating both the Scitech .NET Memory Profiler 3.1 and ANTS Memory Profiler 5.1 (current versions as of September 2009). I tried the JetBrains one a year or two ago and it wasn't as good as ANTS (for memory profiling) so I haven't bothered this time. From reading the web sites it looks like it doesn't have the same memory profiling features as the other two.

Both ANTS and the Scitech memory profiler have features that the other doesn't, so which is best will depend upon your preferences. Generally speaking, the Scitech one provides more detailed information while the ANTS one is really incredible at identifying the leaking object. Overall, I prefer the ANTS one because it is so quick at identifying possible leaks.

Here are the main the pros and cons of each from my experience:

Common Features of ANTS and Scitech .NET Memory Profiler

  • Real-time analysis feature
  • Excellent how-to videos on their web sites
  • Easy to use
  • Reasonably performant (obviously slower than without the profiler attached, but not so much you become frustrated)
  • Show instances of leaking objects
  • Basically they both do the job pretty well

ANTS

  • One-click filters to find common leaks including: objects kept alive only by event handlers, objects that are disposed but still live and objects that are only being kept alive by a reference from a disposed object. This is probably the killer feature of ANTS - finding leaks is incredibly fast because of this. In my experience, the majority of leaks are caused by event handlers not being unhooked and ANTS just takes you straight to these objects. Awesome.
  • Object retention graph. While the same info is available in Scitech, it's much easier to interpret in ANTS.
  • Shows size with children in addition to size of the object itself (but only when an instance is selected unfortunately, not in the overall class list).
  • Better integration to Visual Studio (right-click on graph to jump to file)

Scitech .NET Memory Profiler

  • Shows stack trace when object was allocated. This is really useful for objects that are allocated in lots of different places. With ANTS it is difficult to determine exactly where the leaked object was created.
  • Shows count of disposable objects that were not disposed. While not indicative of a leak, it does identify opportunities to fix this problem and improve your application performance as a result of faster garbage collection.
  • More detailed filtering options (several columns can be filtered independently).
  • Presents info on total objects created (including those garbage collected). ANTS only shows 'live' object stats. This makes it easier to analyze and tune overall application performance (eg. identify where lots of objects being created unnecessarily that aren't necessarily leaking).

By way of summary, I think ANTS helps you find what's leaking faster while Scitech provides a bit more detail about your overall application memory performance and individual objects once you know what to look at (eg. stack trace on creation). If the stack trace and tracking of undisposed disposable objects was added to ANTS I wouldn't see the need to use anything else.

Ben Robbins
  • 2,889
  • 2
  • 31
  • 32
  • The 4.0 version of .NET Memory Profiler (now in preview) now has a graph view. This was the one feature I liked in the ANTS profiler that Scitech one didn't have (in 3.1/3.5). – cplotts Apr 14 '11 at 21:50
45

I recently discovered EQATEC Profiler http://www.eqatec.com/tools/profiler. It works with most .NET versions and on a bunch of platforms. It is easy to use and parts of it is free, even for commercial use.

TrolleFar
  • 950
  • 8
  • 10
  • Fails on tail calls too :( Reported bug. – leppie Jul 16 '09 at 17:44
  • This one is only free for non-commercial use. – Jon Seigel Jan 25 '10 at 14:33
  • 7
    It was completely free back in Aug '08 when TrolleFar wrote his answer. Now, as Jon says, it is only free for non-commercial use. – Richard Flamsholt Mar 21 '10 at 22:41
  • 8
    Turns out that they changed the license terms again. Parts of it is free for commercial use again. – TrolleFar Apr 22 '10 at 09:33
  • As of FEB2011 normal .NET edition for self/commercial is free. This tool is nice because it works on client/server model and can profile/by-pass repeated boundaries (e.g. Native->COM->NET->COM->NET can be profiled). The UI is rather awful though :-) –  Feb 03 '11 at 00:56
31

[Full Disclosure]

While not yet as full-featured as some of the other .NET memory profilers listed here, there is a new entry on the market called JustTrace. It's made by Telerik and it's primary goal is to make tracing/profiling easier and faster to do for all types of apps (web/Silverlight/desktop).

If you've ever found profiling and optimization intimidating or slow with other tools, then JustTrace might be worth a look.

Community
  • 1
  • 1
Todd
  • 5,538
  • 1
  • 31
  • 34
  • 12
    When I go to download it and try it out, Telerik wants me to "register" and "create an account." And all those newsletter subscription buttons are checkmarked by default. I'd be happy to give JustTrace a try, but not if Telerik makes it this difficult. – Ryan Lundy Sep 20 '11 at 18:32
  • 1
    Thanks for trying, Kyralessa. We know that process can be improved. We're working on that right now. We hope to remove those hurdles soon. For now, just uncheck the boxes and in 2 min you can have an account and free JustTrace download. Sorry for the short-term trouble. -T – Todd Sep 20 '11 at 21:24
  • 4
    Update: Today I was able to download using the link in the answer without having to create an account. – Ryan Lundy Jan 01 '12 at 07:02
25

Don't forget nProf - a prefectly good, freeware profiler.

Shog9
  • 156,901
  • 35
  • 231
  • 235
Greg Hurlman
  • 17,666
  • 6
  • 54
  • 86
14

I have found dotTrace Profiler by JetBrains to be an excellent profiling tool for .NET and their ASP.NET mode is quality.

Chris Ballance
  • 33,810
  • 26
  • 104
  • 151
12

ANTS Profiler. I haven't used many, but I don't really have any complaints about ANTS. The visualization is really helpful.

palmsey
  • 5,812
  • 3
  • 37
  • 41
11

AutomatedQA AQTime for timing and SciTech MemProfiler for memory.

Lars Truijens
  • 42,837
  • 6
  • 126
  • 143
  • MemProfiler has save our team when we had a memory leak. I tried other tools, but no other tool gave the same detail. – oglester Sep 15 '08 at 00:26
11

If you're looking for something quick, easy, and free, http://code.google.com/p/slimtune/ seems to do the job fine.

Taudris
  • 1,413
  • 1
  • 15
  • 23
9

I've been working with JetBrains dotTrace for WinForms and Console Apps (not tested on ASP.net yet), and it works quite well:

They recently also added a "Personal License" that is significantly cheaper than the corporate one. Still, if anyone else knows some cheaper or even free ones, I'd like to hear as well :-)

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Michael Stum
  • 177,530
  • 117
  • 400
  • 535
7

Don't forget the awesome scitech .net memory profiler

It's great for tracking down why your .net app is running out of memory.

Sam Saffron
  • 128,308
  • 78
  • 326
  • 506
  • 1
    Very nice tool. Easy to use and allows you to navigate through your object graph. I espacially like the 'realtime' memory tracking. It shows you how your object counts develop during the runtime of the application. – lowglider Jan 20 '09 at 09:00
5

I would add that dotTrace's ability to diff memory and performance trace sessions is absolutely invaluable (ANTS may also have a memory diff feature, but I didn't see a performance diff).

Being able to run a profiling session before and after a bug fix or enhancement, then compare the results is incredibly valuable, especially with a mammoth legacy .NET application (as in my case) where performance was never a priority and where finding bottlenecks could be VERY tedious. Doing a before-and-after diff allows you to see the change in call count for each method and the change in duration for each method.

This is helpful not only during code changes, but also if you have an application that uses a different database, say, for each client/customer. If one customer complains of slowness, you can run a profiling session using their database and compare the results with a "fast" database to determine which operations are contributing to the slowness. Of course there are many database-side performance tools, but sometimes I really helps to see the performance metrics from the application side (since that's closer to what the user's actually seeing).

Bottom line: dotTrace works great, and the diff is invaluable.

shaunmartin
  • 3,849
  • 2
  • 25
  • 26
4

AQTime is reasonable, but has a bit of a learning curve and isn't as easy to use as the built in one in Team Suite

Jeff Moser
  • 19,727
  • 6
  • 65
  • 85
3

The current release of SharpDevelop (3.1.1) has a nice integrated profiler. It's quite fast, and integrates very well into the SharpDevelop IDE and its NUnit runner. Results are displayed in a flexible Tree/List style (use LINQ to create your own selection). Doubleclicking the displayed method jumps directly into the source code.

David Schmitt
  • 58,259
  • 26
  • 121
  • 165
3

In the past, I’ve used the profiler that ships with Visual Studio Team System.

Ant
  • 1,156
  • 11
  • 15
2

The latest version of ANTS memory profiler (I think it's 5) simply rocks!!! I was haunting a leak using WinDbg and SOS since it proved to be the best way before, then I tried ANTS and I got it in minutes. Really a wonderful piece of software.

pablo
  • 6,392
  • 4
  • 42
  • 62
2

I would like to add yourkit java and .net profiler, I love it for Java, haven't tried .NET version though.

Redlab
  • 3,110
  • 19
  • 17
2

I've worked with RedGate's profiler in the past. Did the job for me.

Kev
  • 118,037
  • 53
  • 300
  • 385
2

Haven't tried it myself, but maybe dotTrace? Their ReSharper application is certainly a good one. Maybe dotTrace is too :)

Svish
  • 152,914
  • 173
  • 462
  • 620
2

I doubt that the profiler which comes with Visual Studio Team System is the best profiler, but I have found it to be good enough on many occasions. What specifically do you need beyond what VS offers?

EDIT: Unfortunately it is only available in VS Team System, but if you have access to that it is worth checking out.

Brian Rasmussen
  • 114,645
  • 34
  • 221
  • 317
  • 1
    I was talking about the one in VS2008, but it may not be available in all version (I'm using VSTS). From the PDC2008 videos it seems like the profiler will improve a lot in VS2010. – Brian Rasmussen Mar 04 '09 at 22:25
  • 1
    That profiler is only available with the Team Systems versions of Visual Studio. – Chris Brandsma Mar 04 '09 at 22:28
  • Visual Studio Team System (Developer Edition) has a profiler. See . – gix Mar 04 '09 at 22:29
  • Visual Studio has a profiler since VS 2005. It is only available with Team System. That is, in fact, the reason I use team system (at work I have professional). It is a very good profiler, in my opinion. – configurator Mar 04 '09 at 22:34
  • It's a fine profiler, but it's not quite up to the standard of the new version of ANTS. – mqp Mar 09 '09 at 13:38
1

Unfortunate most of the profilers I tried failed when used with tail calls, most notably ANTS. I just end up writing my own. There is a simple implementation on CodeProject that you can use as a base.

leppie
  • 115,091
  • 17
  • 196
  • 297
1

Intel® VTune™ Performance Analyzer for quick sampling

  • @utility73 - really great line-by-line CPU cost breakdown in vtune -- which is exactly what I was hunting for today. Thanks for suggesting this. – Sichbo Feb 26 '11 at 01:01
1

I must bring an amazing tool to your notice which i have used sometime back. AVICode Interceptor Studio. In my previous company we used this wonderful tool to profile the webapplication (This is supposed to be the single largest web application in the world and the largest civilian IT project ever done). The performance team did wonders with the help of this magnificent tool. It is a pain to configure it, but that is a one time activity and i would say it is worth the time. Checkout this page for details.

Thanks, James

Community
  • 1
  • 1
1

For me SpeedTrace is the best tool on the market because it does not only help you to find bottlenecks inside your applications. It also helps you in troubleshooting scenarios to find out why your application was crashing, your setup did not install, your application hung up, your application performance is sometimes poor depending on the data input, e.g. to identify slow db transactions.

Dirk
  • 11
  • 1
1

The NuMega True Time profiler lives on in DevPartner Studio by Micro Focus. It provides line and method level detail for .NET apps requiring only PDBs, no source needed (but it helps.) It can discriminate between algorithmically heavy routines versus those with long I/O waits using our proprietary per thread kernel mode timing driver. Version 10.5 ships with new 64-process support on February 4, 2011. Shameless plug: I work on the DevPartner product line. Follow up at http://www.DevPartner.com for news of the 10.5 launch.

Disclaimer: I am the Product Manager for DevPartner at Micro Focus.

Community
  • 1
  • 1
Matt Schuetze
  • 1,112
  • 8
  • 9
  • welcome to SO. You will need to disclose any relationship to DevPartner or you will be considered a spammer and dealt with as such. I see you've answered a number of profiling questions... – John Saunders Jan 31 '11 at 04:07
1

I've been testing Telerik's JustTrace recently and although it is well away from a finished product the guys are going in the right direction.

Ivan Petrov
  • 628
  • 6
  • 12
1

If Licensing is an issue you could try WINDBG for memory profiling

Vibes
  • 33
  • 6
0

We selected YourKit Profiler for .NET in my company as it was the best value (price vs. feature). For a small company that wants to have flexible licensing (floating licenses) it was a perfect choice - ANTS was developer seat locket at the time.

Also, it provided us with the ability to attach to the running process which was not possible with dotTrace. Beware though that attaching is not the best option as everything .NET will slow down, but this was the only way to profile .NET applications started by other processes. Feature wise, ANTS and dotTrace were better - but in the end YourKit was good enough.

  • Starting from January 2012, YourKit have raised the pricing for the YourKit profiler. Therefore, the price advantage may no longer be valid. –  Jan 19 '12 at 15:32
0

I've found plenty of problems in a big C# app using this.

Usually the problem occurs during startup or shutdown as plugins are being loaded, and big data structures are being created, destroyed, serialized, or deserialized. Often they are created and initialized more than once, and change handlers get added multiple times, further compounding the problem.

In cases like this, the program can be so sluggish that only 2 samples are sufficient to pinpoint the guilty method / function / property call sites.

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135
0

If you're on ASP.NET MVC, you can try MVCMiniProfiler (http://benjii.me/2011/07/using-the-mvc-mini-profiler-with-entity-framework/)

eka808
  • 2,257
  • 3
  • 29
  • 41