asp:review
ANTS Profiler 3.0
.NET Profiler for Performance and Memory Usage
By Steve C. Orr
Nobody writes perfectly optimized code on their firstattempt. In fact, most experienced programmers will tell you that it?s a badidea to even try because optimizing code that is not a bottleneck generallydoesn?t make a program run any faster ? and trying to guess which parts of aprogram will run slowest is usually futile. Therefore, it?s generally best towrite code first, then identify bottlenecks and optimize them. Of course, thebig question then becomes, ?How do I identify the bottlenecks?? Without a toolsuch as ANTS Profiler, there is no easy answer to that question.
So How Does It Work?
ANTS Profiler observes a program as it runs and takesdetailed notes about which parts take the longest to execute and which objectseat the most memory. It allows you to drill all the way down to individuallines of code to identify promising optimization targets. Each line of code hasits execution time precisely measured and the results are color coded, so itrarely takes more than a glance to see which code segments need the mostattention. Each instantiated object has its memory footprint measured so youcan tell where all that RAM is going (see Figure 1). Various snapshots can betaken throughout the execution of the program to reveal how the memoryfootprint changes over time. This can be pivotal for tracking down memory leaksor optimizing inefficient memory usage.
Figure 1: Every object instantiatedin your program can have its memory footprint measured at various points duringexecution to help track down memory leaks and inefficient memory-hoggingfunctions.
One of your first tasks when you start ANTS Profiler (fromthe Windows Start menu or from the integrated Visual Studio menu) is to choosewhich kind of program you want to profile. You can profile desktopapplications, ASP.NET Web applications, Windows services, or COM+ serverapplications (see Figure 2).
Figure 2: ANTS Profiler can profilemost major types of .NET applications.
The user interface could perhaps be a bit more intuitive,but anyone brainy enough to be profiling software applications should be ableto figure it out with no more than 30 minutes of tinkering. Essentially, thelargest objects or slowest performing functions are listed at the top, and eachitem below is progressively less significant. Clicking on an item in the listwill let you drill down through its children and all the way down to theunderlying lines of code. The results pane is rather hidden over on the rightside of the ANTS Profiler main window, so keep an eye out for it because it?sessential for comparing various snapshots taken throughout the execution ofyour program (to see how things change over time).
I put the ANTS Profiler through its paces with a sluggishprogram on which I?d been working. It clearly identified which functions andlines of code were the slowest. Using this knowledge, I was able to restructuremy program and use some alternate functions to improve dramatically the speedof my application. It was also able to put my mind at ease about a suspectedmemory leak. Indeed, this program does live up to its promises.
Support System
ANTS Profiler supports operating systems ranging fromWindows 2000 through Windows Vista, and even Windows Server Longhorn (which wasstill in beta at the time of this writing). It also supports all the latest.NET 3.0 technologies, such as Windows Communication Foundation (WCF), WindowsPresentation Foundation (WPF), and Windows Workflow Foundation (WF). It willprofile any .NET language ? not only C# and VB.NET, but also managed C++,Cobol.NET, and virtually any other .NET variation you may discover. IISversions 5 through 7 are supported, and even ASP.NET?s built-in Cassini Web serveris supported, as well. Likewise, 64-bit applications are no problem.
The ANTS Profiler Web site has some jaw-dropping featuresto get you started in no time. The demonstration video will show you in momentshow simple the ANTS Profiler program can be to use; the walk-throughs are yetanother innovative and intuitive product introduction. After exploring theseuseful items I had to wonder why every software company doesn?t have suchuseful features on their Web sites.
Of course, their Web site also contains all the otherusual support you?d expect from a professional software company, such as a FAQsection, knowledge base, forums, documentation, etc. Personalized e-mail andphone support contracts can be purchased for 25% of the product price.
The single-user price of US$295 for the ANTS Profilerstandard edition is reasonable, considering the time it saves and the dramaticperformance increases it can help achieve. The memory profiling is onlyavailable in the professional version, which costs US$495 and includes aprofiling API. For an extra US$100 you can get an ANTS Bundle, which includesall the above, plus load and stress testing tools for Web applications.
Cure Bloatware
Every self-respecting software developer wants code thatruns quickly and efficiently. However, by looking at the large number ofbloated applications out there it?s clear that more developers should be usingtools such as ANTS Profiler. Without such a tool, effective optimizing code canbe quite challenging ? and is too often left undone. To avoid contributing tothe global epidemic of bloatware, I suggest you download the free 14-day trialof ANTS Profiler to see firsthand what it can do for your code and yourreputation as a software creator.
Steve C. Orr is anASPInsider, MCSD, Certified ScrumMaster, Microsoft MVP in ASP.NET, and authorof the book Beginning ASP.NET 2.0 AJAX by Wrox. He?sbeen developing software solutions for leading companies in the Seattlearea for more than a decade. When he?s not busy designing software systems orwriting about them, he can often be found loitering at local user groups andhabitually lurking in the ASP.NET newsgroup. Find out more about him at http://SteveOrr.net or e-mail him at mailto:Steve@Orr.net.
Rating: ????
Web Site: http://www.red-gate.com/products/ants_profiler
Price: Starts atUS$295