<p>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.</p>

<p>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 <strong>free</strong> solution.</p>

[{'answer_id': 3945, 'author': 'Yaakov Ellis', 'author_id': 51, 'author_profile': 'https://Stackoverflow.com/users/51', 'pm_score': 1, 'selected': False, 'text': '<p><a href="http://nprof.sourceforge.net/Site/Description.html" rel="nofollow noreferrer">nProf</a> is a free .Net profiler (<a href="https://stackoverflow.com/questions/3927/what-are-some-good-net-profilers#3935">ref</a>). </p>\n'}, {'answer_id': 3946, 'author': 'Greg Hurlman', 'author_id': 35, 'author_profile': 'https://Stackoverflow.com/users/35', 'pm_score': 1, 'selected': False, 'text': '<p><a href="http://nprof.sourceforge.net/Site/Description.html" rel="nofollow noreferrer">nProf</a> is a good, free tool for .Net Profiling.</p>\n'}, {'answer_id': 4238, 'author': 'Nathan', 'author_id': 541, 'author_profile': 'https://Stackoverflow.com/users/541', 'pm_score': 3, 'selected': True, 'text': '<p>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. </p>\n\n<p>We use the <a href="http://www.red-gate.com/products/ants_profiler/index.htm" rel="nofollow noreferrer">ANTS profiler</a> from RedGate and have been very happy with it. I have also used <a href="http://memprofiler.com/features.aspx" rel="nofollow noreferrer">.NET Memory Profiler</a> 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.</p>\n\n<p>The JetBrains folks <a href="http://www.jetbrains.com/profiler/" rel="nofollow noreferrer">have a profiler as well called dotTrace</a> 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.</p>\n\n<p>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.</p>\n'}, {'answer_id': 4581598, 'author': 'winwaed', 'author_id': 481927, 'author_profile': 'https://Stackoverflow.com/users/481927', 'pm_score': 0, 'selected': False, 'text': "<p>Visual Studio also comes with a performance profiler which is pretty good. it doesn't come with all versions - for VS2008, I think it is the Developer Edition you need.</p>\n"}]
['https://Stackoverflow.com/questions/3942', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/443/']