views:

209

answers:

5

What tools are available to profile a .NET program by measuring function execution times and generating graphs to visualize the time spent at various points in the call graph?

+2  A: 

It'll cost you but Ants Performance Profiler will do the job.

Jeremy
That is by far my favorite.
Jonathan Allen
+1  A: 

CLR Profiler

oykuo
A: 

There is a free C# IDE SharpDevelop 3.1, which has integrated profiler, and it is compatible with Visual Studio solutions.

Martin Konicek
+2  A: 

AQTime and dotTrace are two very good commerical profilers.

A free option would be ProfileSharp, though I have had little luck with it.

Microsoft provides the CLR Profiler as well, which works well, but has fewer features.

Reed Copsey
CLR profiler doesn't seems to work with .net 4.0
Gorgen
@Gorgen: Nope - this post pre-dated VS 2010 and .NET 4. However, higher end SKUs of VS include a very nice profiler, now.
Reed Copsey
@Reed: ok, that is why they have stopped updating the product. unfortunately do I use the Express version, it is in reach of my budget. Any sugestions?
Gorgen
@Gorgen: I suspect this is because they market it commercially, plus the CLR 4's profiling entry points have changed a lot. That being said, there are a few decent free profilers out there. Try SlimTune: http://code.google.com/p/slimtune/ or EQUATEC: http://www.eqatec.com/Profiler/Download.aspx
Reed Copsey
@Reed: thanks a lot, I will try them.
Gorgen
A: 

What's the goal? Do you just want to 1) See a nice call graph with times on it, or 2) Locate cost points to optimize to make your program faster?

If the answer is (2), and you don't mind something that's free, you can try this.

This gives an example of how to use it.

Mike Dunlavey