I inherited a Windows Forms app written in VB.Net. Certain parts of the app run dreadfully slow. What's the easiest way to find which parts of the code are holding things up? I'm looking for a way to quickly find the slowest subroutines and tackle them first in an attempt to speed up the app.

I know that there are several code profiler products available for purchase which will show how long each subroutine takes, but I was hoping to find a free solution.

+1  A: 

nProf is a free .Net profiler (ref).

Yaakov Ellis
+1  A: 

nProf is a good, free tool for .Net Profiling.

Greg Hurlman
+3  A: 

I appreciate the desire to find free software. However, in this case, I would strongly recommend looking at all options, including commercial products. I tried to play with nProf (which is at version 0.1 I think) and didn't have much luck. Even so, performance profiling an application is a subtle business and is best approached using a powerful, flexible tool. Unless you are working for free, I strongly believe the time you will save using a professional product will far outweigh the cost of a license. And of course, if you are only wanting to profile a single application, each commercial package has a 15 or 30 day trial, more than enough time to pinpoint any issues in an existing application. And if you need profiling support for more than just the one-off project, you're better buying a full strength tool anyway.

We use the ANTS profiler from RedGate and have been very happy with it. I have also used .NET Memory Profiler with excellent results. The cool thing about .NET Memory Profiler is that it can attach to and profile running production applications, which really saved our butts when we had a memory leak in production we couldn't reproduce in our test lab.

The JetBrains folks have a profiler as well called dotTrace which I haven't tried, but I have to believe that if it comes from the JetBrains shop it is probably top notch as well.

Anyway, my advice is this: try to fix your app within the free trial window of one or an aggregated combination of the three of them (minimum of 45 days free use) and if that isn't enough time, pick your favorite and spring for one of them. You won't be sorry.