Is your .NET application running a little slow and you need an easy way to find the bottleneck in your code? ANTS Profiler, from Red Gate Software, will show you the frequency and time spent for each line of your code. This way you will be able to identify areas of your source code that may be improved to increase application speed. ANTS Profiler will perform code profiling on .NET Windows applications, ASP.NET web applications, and .NET web services.
Installation of ANTS Profiler is fully automatic, making it a breeze. There is no complicated configuration required during install or prior to running the program. In fact, Red Gate Software has included a sample Windows program, as part of the tutorial, that comes up as the default project. So all you really have to do is start ANTS Profiler, hit the GO button, and you are profiling the sample program.
Project setup is very simple. Just browse to or type in the location of the application you want to profile. That's all that is required to set up a profiling project. The tutorial is good and will have you profiling in no time.
The code profiling results are extensive. You can drill down into the results from three starting positions: 1) top-level functions, 2) slowest 100 functions, and 3) source files. Drilling down from any of these locations will take you to a line-by-line profile of your code, which gives you the number of times a line was run (hits) and how long it took to run (time).
You can save projects and result sets separately. This allows you to have multiple result sets from the same project. You could use this to compare results after making improvements.
When I contacted Red Gate's technical support, the response was quick and accurate. This is quite a plus when you are learning a new piece of software.
What I Learned
To use ANTS Profiler on your application you must compile it in debug mode. Compiling a debug build creates a symbols file in addition to your application. Microsoft's definition of these symbols (.pdb files) tells the debugger how to find the original source files for a binary and how to map breakpoints in code to lines in those source files. In short, ANTS Profiler needs this file to find the source code files so that it can profile each line of code.
Room for Improvement
ANTS Profiler automatically runs the application being profiled (Internet Explorer in the case of web applications), but you have to manually run the application through its paces. The only functions that get profiled are the ones that you run while profiling. If you have a large application, it will take some time to go through all of the functions. It would be nice if this could be automated, but maybe that's asking too much.
I did try to run ANTS Profiler on a machine that had two versions of the .NET framework installed, versions 1.1 and 2.0 beta. ANTS Profiler did not work with .NET beta 2 installed. I'm sure this is going to be a common theme until Microsoft comes out with the final release of .NET 2.0.
It would be nice if you could export the results to a format that is easier to share with others. For example, it would be very useful if you could save the results as Word, PDF, HTML, or even XML.
Trying to find bottlenecks in your code can be time consuming and stressful. ANTS Profiler can help you quickly find code slow downs saving you time and eliminating at least some stress from your life.
Even if you are not having problems with your applications, code profiling can help you find even small bottlenecks. I highly recommend ANTS Profiler for developers who want to verify that their code is operating at peak efficiency, for those searching for code bottlenecks, and for those that want to learn about the speed of different functions.