Vladimir Vukićević — Words
 



AQtime

In response to my previous post about VTune and Shark, a number of people suggested alternate tools.  Both the tools suggested, AQtime and GlowCode, had evaluation versions easily available so I figured I'd give them a try and write up a mini review of each.

First up is AQtime.  This tool takes an instrumentation approach, which limits it in some ways while making it robust in others.  Program execution is significantly slowed down, by about 5-10x in my experience.  This is a downside, because in my case, it makes it difficult to use a firefox build for testing various benchmarks, and then quickly be able to jump in to get a profile once I hit a problematic case.  However, unlike Quantify (which I won't be looking at — it's almost impossible to get working with Mozilla), it instruments code extremely quickly (a few seconds for xul.dll, which is 12MB in size), so the instrumentation step doesn't get in your way.

The app itself is pretty well designed; it suffers from the typical windows developer tool problem of lots of toolbars and subviews, but everything seems to be functional, and you can hide most things to get them out of your way.  Its performace profiler only seems to instrument at event granularity (function call, branch miss, etc.), so you don't get to see exactly where time is spent within each function.  (Edit: this is incorrect, apparently; check out the comments on this post.  You can do line-by-line instrumentation; I just missed it in the UI.)  This is probably its most serious failing, but because of that approach, it can give very accurate call graphs and traces with exact function execution counts.  Despite its approach, it's able to give user time pretty accurately — it removes the time spent in bookkeeping, so even though a testcase might have taken a 30 seconds of wall clock time to run, it will still show 2000ms as the total time for the run.  That's roughly roughly the time that running the benchmark takes without AQtime, within a few percent.

Here's the AQtime main view:

Through the call graph pane, you can quickly start navigating either function children or function descendants.  This could really be integrated directly into the overall function view above; I found myself ignoring that pane for the most part and focusing on the call graph view.  The source code view wasn't useful — it just annotated each function's header with the total time/total self time — but I can see it being more useful if I were capturing branch misses or one of the other bits of data that the profiler can capture.

Because of the instrumentation approach, AQtime is able to offer a number of other useful profilers (similar to skins in valgrind parlance), including an allocation analyzer (which I'll probably blog about separately), code coverage, and a number of static analysis and tracing options.

AQtime is a useful tool, and I've already used it to track down one problem and am using it to examine another.  Its accurate function call counts have been helpful — for example, while looking at a particular case, a specific function is being called 110,000 times.  With one version of the code, that operation took 1200ms.  With a newer revision, those 110,000 calls are now taking 2200ms.  What changed?  Walking down the call stack and seeing exactly where the chunks of time were going helped answer that question.  Instrumentation does make some types of optimization work impossible (in particular, microoptimization at the function level), but combined with the full complement of analysis tools it makes available, it makes for a pretty powerful package.

Next up is GlowCode; I've got a different problem that I'll be attacking with it.


One Comment to “AQtime”  

  1. 1 Erik

    AQTime has a line profiler mode, if that is what you are after. Here is a screenshot of it in action:
    http://www.automatedqa.com/products/aqtime/images/aqtime5/line_profiling_results.gif
    To go into line mode, you choose Full Check By Lines in the Areas view:
    http://www.automatedqa.com/products/aqtime/images/aqtime5/setup_panel.gif

    I’ve found it is most useful if you narrow down the classes/modules it instruments – otherwise, you are correct that it can slow down the application quite a bit. You can also turn on the profiling when it enters a method and turn it off when it exits for better speed, though I found the “triggers/actions” GUI for doing that fairly unintuitive at first.

Leave a Reply