tags:

views:

141

answers:

3

Hi,

I'm faced with a big old stack of method calls in some legacy code, one or some of which is creating a bottleneck and really slowing things down. Is there any quick way I can get a report on which method calls are taking the time, short of running in debug, stepping through and seeing where the cursor pauses?

+10  A: 

Use a profiler. I personally use JetBrains dotTrace but that's mainly because I was given a free licence as an MVP. There are other tools available too, such as RedGate's ANTS. I haven't used the ANTS one myself.

There's a free profiler from Microsoft which targets .NET 2.0; I expect it would work with .NET 3.0 and 3.5 as well, but quite possibly not .NET 4 as that has a new CLR. My own experience with this is that it's somewhat limited, but can still be useful.

Jon Skeet
+1 for JetBrains dotTrace, I love it :)
Cocowalla
+1. I've tried ANTS before (trial version) and got on well with it. I don't know how it compares to dotTrace, but may be worth trialling both
AdaTheDev
+3  A: 

Try Eqatec

Joe R
Interesting - I haven't come across that one before. I'll give it a try and see how it compares with dotTrace...
Jon Skeet
Okay, I'm already somewhat put off by the fact that they claim it's free on the download page - but then you read on and find out that it's a free 30 day evaluation.
Jon Skeet
@Jon, their Free license is for non-commercial projects. For commercial projects the user should purchase a Personal license.
Nick D
@Nick D: Ah, I misread it as saying the personal was for even non-commercial use after 30 days.
Jon Skeet
Marketing weasels up to their tricks again! At least it's free for non-commercial projects.
Joe R
Richard Flamsholt
@Richard - excellent! :) I'll have a look tomorrow.
Joe R
@Joe: I don't think it was really a marketing problem in this case - I only expected it to be free for non-commercial use. I then just failed to read the licence terms properly :(
Jon Skeet
+2  A: 

SlimTune is another free and open source profiler.

wroks