Bart

Software Engineer - Red Gate Software

Looking over the developers' shoulders: ANTS Performance Profiler 4 – our first proper early access build

Published Monday, May 12, 2008 2:37 PM

For those of you with the stomach for this kind of thing, today, for the first time, we’ve made available a bleeding edge build of a product in development. We did admittedly trial this with Exception Hunter 1.1, but we kept it pretty quiet because it really was a bit of an experiment on many levels, and as expected there were a few headaches. But we're now feeling more confident about the whole process, so I’m very pleased to be able to tell you that you can get your hands on a very early, very rough version of ANTS Performance Profiler 4. The build numbers will change with every version so you'll find download links in the feedback forum at:


http://www.red-gate.com/messageboard/viewforum.php?f=80

Now let me be absolutely clear about this: it’s not a beta, it’s not beta quality, it really is a just a development build, so it’s rough and it might crash, or behave strangely sometimes. We’ve spent about an hour testing it to ensure the installer works and that’s it… well OK, we’ve retested it about 800 times because we kept finding bugs, and we fixed some x64 problems before we put it out, and all of that took a lot more than an hour let me tell you, but basically it’s a build we just yanked from our build server. Being the first time round though we wanted to make sure it wouldn't immediately crash for everyone who downloaded it.


So if you’re feeling brave you might want to download it and give it a try. It (probably) won’t crash your computer, and it certainly won’t reformat your hard disk. You probably won’t die simply because you installed it either, although beyond that I wouldn’t like to make too many guarantees about its stability or fitness for purpose. We’d certainly like to know what you think about the new direction we’re taking with it, so please post your feedback and ideas in the forum.


I imagine that after that blistering sales pitch you’re just gagging to get your hands on it so, before I move on to being a little more positive about the whole thing, let me just reiterate one last time that this is definitely not up to the standard of a normal Red Gate beta in terms of either quality or features.


Right, now that I've got the disclaimers out of the way, I should point out that we really are quite excited about this, and we really hope that, despite the warts, you’re going to like it.


So what can you expect from this build?


  1. Much improved performance: in general it’s around 5x faster than ANTS Profiler 3 when recording both method and line level timings. It can be up to 30x faster depending upon what you’re doing.
  2. New timeline, which allows you select the region for which you’re interested in viewing performance data. No need to keep stopping and restarting the data. Just run the profiler once against your application and run through all the tasks you need to perform, then drag out a region on the timeline to view performance data for the period when you performed each task.
  3. New call tree, allowing you to see performance data in context and really understand what your application is up to. You can instantly see the hottest path through your application for the time period you’ve selected. You can also summarise the tree at any time to exclude all methods without source code, which makes things even clearer, and is particularly useful for Windows Forms apps, where the bulk of many call stacks is spent in the FCL.
  4. Support for profiling desktop applications, windows services and COM+ servers; ASP.NET will be added later.
  5. Both CPU and wall clock times are recorded, and you can switch between them at any time.
  6. Three different profiling modes: method and line level timings (pretty fast), method level timings only (really fast), or method level timings only for methods with source code (really, really fast).


A quick word on ASP.NET: it's coming soon but it was giving us a few usability headaches so we decided to pull it for now because we’ve redesigned the configuration screens, and re-implementing them would have delayed the build.

Getting Started

It’s pretty simple to get going. Once you’ve downloaded, installed, and run the profiler, you’ll be presented with the project settings dialog box.


First select the type of application, then provide the required information; for example, if you select a desktop application—this can also be a console app—you need to tell the profiler where the executable is. You may need to supply some arguments, but if not you can probably just hit Start Profiling, unless you only want method level timings (see below).


The Default timing display setting allows you to choose between Wall clock and CPU timings. The difference is that wall clock time includes time spent blocking, e.g., sleeping, waiting for I/O, and so on, whereas CPU time doesn’t include this. Each setting is useful in different contexts. You don’t need to worry about changing this now, if you don’t want to, because you can switch at any time later on using the drop-down beneath the tree view.


The Profile child processes option does exactly what it says on the tin, but at the moment you can’t view any results for child processes so you may as well uncheck it. To be honest it doesn’t make a lot of difference though so it doesn't matter that much.


Note that saving/loading of project settings isn’t yet supported, but it should remember your last settings when you next start up the profiler (it might forget the application type though). I'd also recommend that if you want to start a new profiling session you exit and restart the profiler, rather than hitting File > New Profiling Session, because things can tend to get a little messy otherwise.


When you start profiling the profiler will start your application and begin collecting performance data. You’ll see that the timeline at the top of the screen also starts collecting data about your application. The orange trace shows the amount of CPU time your application is using. A word of caution here: the y-axis of the trace auto-scales to include the maximum and minimum values, but we don’t yet display any axis labels, so you won’t really have too much idea what the actual value is: just because the trace is hovering near the top of the graph doesn’t mean your process is necessarily using nearly 100% CPU time, although in general this probably would be the case. Again, we'll sort this out later so you don't have to cross check with Task Manager.


Whilst the profiler is running do whatever it is you need to do with your application to manifest any performance problem, assuming you have one, or if you just want to get an overview of your application's performance, just carry out a typical set of actions. You should find that in either situation ANTS Performance Profiler can provide you with useful information.


Once you're finished you can do one of two things. The first and most obvious is click the big red Stop button to the right of the timeline and wait for the profiler to summarise all the performance data it's collected for the whole time your application was running. You can also just close your application. Whatever you do, don't click Stop more than once. You'll end up with it just sitting there for ever and a day with no results. If you do do this, just drag out a region on the timeline and you'll see some performance data appear. Obviously we'll fix this as well in a later build.


Summarisation can take anywhere from a couple of seconds to several minutes, although I'd say 10 - 30 seconds is about average, depending upon what you've been doing, the call complexity of your application, how long you've left it running, etc. If your machine's CPU usage is at 0% for any length of time but the profiler still claims to be summarising data then probably something has gone wrong, but it's not irredeemable. As above you can just drag out a region on the timeline to see results for that region.


Once summarisation is complete you'll see a representation of all the stack traces in your application, or all the stack traces within the time period you've selected, if this is what you did. By default they're displayed top down, i.e., with root methods, such as main(), as the tree roots (for threads other than the main thread the root method will be different). You can also display a bottom up view, which not surprisingly starts at the deepest methods—actually there's a heuristic here so we only include anything that takes more than 1% of execution time—and then as you drill down the child nodes progress up to the highest level calling methods; thus main() will be shown as one or more leaf nodes.


In both views you'll find that the hottest paths—i.e., stack traces—through the application are expanded, and are shown at the top of the tree. We always expand down to (or up from) a level where there is at least one method that takes 1% or more of the total execution time. For the sake of clarity and performance, we only expand stack traces towards the top of the tree. We'll provide a right-click menu option in future to allow you to “smart expand” any method in this way without needing to click down through all the child methods manually.


Personally I prefer the top down view, but that's just me, and I think both views have their uses. Another feature I also really like, and which I think you'll find really useful, are the abridged views. These views exclude virtually all methods without source code from the tree view, which can be extremely handy if you're calling into or through a lot of library code. They're very similar to the view you'll see if you choose to profile only methods with source code, and provide a similar degree of clarity if you want line level timings. Sometimes, of course, you're going to want to see if some of the libraries you're using are guilty of slowing down your application.


These different views can be selected by using the appropriate drop-down below the tree view.


Just like ANTS Profiler 3, you can view source code, where it's available. Any method with source code will be rendered in bold in the tree view. Just click on it to highlight it and the source code view will appear. If you've chosen to profile line level timings these will be shown for your method. Line level timings for other methods in the file will also be populated in the background.


For now that's about it, although we hope there's enough there to be useful. Finally, remember, you can switch between CPU and wall clock time at any time once you've got some results. You can also do the same for timing representations: percentages are the default, but you can also choose ticks, or actual times.


We'll be making these builds available on pretty regular basis, and as each build is released we'll announce it on the forum:

http://www.red-gate.com/messageboard/viewforum.php?f=80


I'd recommend subscribing either to email notifications or the RSS feed if you want these. I'll also post here if any notable bugs have been fixed, or new features added.

by Bart Read
Filed Under: ,

Comments

 

Bart Read said:

Something I forgot to mention is that if you are interested in taking part in usability trials for ANTS Performance Profiler 4 we'd also love to hear from you. Please send an email to usability@red-gate.com.
May 14, 2008 8:37 AM
 

ojm37 said:

Waiting with bated-breath for the ASP.Net version....
May 14, 2008 11:13 AM
 

Bart said:

ANTS Profiler 4 is finally out! We're really excited, obviously, and in this article we share some of the highlights of working on it.
September 2, 2008 11:10 AM
You need to sign in to comment on this blog

About Bart Read

I've had a few jobs since graduating, but for the last four years I've been settled at Red Gate Software in Cambridge, UK. Over that time I've worked on a wide range of products, both as a developer and as a project manager, including 18 months on SQL Prompt; right now I'm finishing up with ANTS Profiler 4, which we think is going to be amazing - hopefully you will too.

















<May 2008>
SuMoTuWeThFrSa
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
A SysAdmin's Guide to Change Management
 In the first in a series of monthly articles, ‘Confessions of a Sys Admin’, Matt describes the issues... Read more...

Exchange: Recovery Storage Groups
 It can happen at any time: You get a request, as Admin, from your company, to provide the contents of... Read more...

Build Your Own Virtualized Test Lab
 Desmon explains the fundamentals of building a test lab for Windows servers and Enterprise applications... Read more...

Rendering Hierarchical Data with the Treeview
 It sometimes happens that Web Server controls that visualize data don't quite fit with the way that... Read more...

SQL Server 2008: Performance Data Collector
 With Performance Data Collector in SQL Server 2008, you can now store performance data from a number of... Read more...