www.automatedqa.com

How to Choose a Code Profiling Tool

AQtime WhitePaper Contents

Why Should You Own A Profiling Tool? 3 Life Without A Profiling Tool 4 Profiler Use Challenges 4 Low Impact, Integrated Profiling Tool 5 AQtime: AutomatedQA’s Profiling Optimization Solution 6 Cost Effective 7 Learn More 9 About AutomatedQA 9 www.automatedqa.com

 Why ShouldYou AProfiling Tool? Own How to aCode Choose Profiling Tool quickly degenerateintoaperformance nightmarewhenplacedunderstress. can optimized been hasn’t that Code simultaneously? it execute users of thousands even or hundreds when happens what but it, executes user one when quickly respond may routine or function operations. Aday to day their in optimization need retailers 2006 and 2005 tween 26%be increased example, for sales, Amazon.com’s traffic. increased the handle can you ensure to need and volume, customer high experiencing you’re perhaps Or company canafford thatkindofnegativeattention. again site that on shop to entirely,not site likely the were abandoned 75% while Akamai also found that more than one-third of online shoppers with a poor experience for a web site to load seconds 8 to up wait would surfers Weekthat Business reported 1999, In spans. tion You mightalsobetryingtokeeppacewithyourendusers’ rapidlydiminishingatten project. tweaks. Thus, programmers need to ensure code runs efficiently from the outset of the length in weeks eight to two from range usually which cycles, development short is teristics an agile development process employ) to looking (or employing are who Focus Digital by surveyed companies of There are numerous reasons to invest in a profiling tool. Maybe you’re one of the 81% exceeds customers’ expectations. or at performs that base code streamlined a is result The performance. poor of areas on in zero to programmers enable and performs application an how diagnose quickly can tools bottlenecks. These performance application’seliminate and locate and code an examine to tool profiling a using in lies solution The valuable? as seen ultimately and efficient quick, is code their that ensure engineers quality and developers soft ware can How faster. run it make to way effective most the determine to reviewed at run code and debugged, analyzed, ofbe must Code written. lines first they’re when performance few peak very is, team development your talented how matter No users, adamagedcorporatereputation,andcountlesslostdollarsinrevenue. to see using it as a waste of time. If left unchecked, this ultimately results in frustrated come and unresponsive, or sluggish application the find may They reaction. different very a have customers way, other some in itself over trips or functions, extraneous calls loops, unnecessary into goes code saver.when However,time a as it view they ecutes quickly and efficiently, customers see an application as responsive and reliable; ex code When company’ssuccess. software a to crucial is performance Application improve applicationperformance. This white paper examines what features to look for when choosing a profiling tool to 2 . These short cycles leave little to no room for code refactoring or performance 3 . By 2006, Akamai found that surfers would only wait 4 seconds. 5 . An increase this dramatic shows how much successful online successful much how shows dramatic this increase . An 1 . One of agile development’s hallmark charac 4 . No . - - - - -

 www.automatedqa.com How to Choose a Code Profiling Tool

Life Without A Profiling Tool

Optimizing code is challenging; it requires time, thought, and investigation from devel- opers. Without the proper tools, programmers have to fall back on slower, less effi cient ways of trying to optimize their applications. Some developers take to “pre-optimiz- ing” code; they guess where performance problems will occur and refactor their code in an attempt to eliminate problems before they appear. This approach is problematic because a developer will often incorrectly diagnose the potential bottleneck. She may look only at her own code, instead of the full code base, thus missing integration is- sues. She may not have insight into her target users’ expected behavior, or she may focus on an area of code that’s infrequently used. While well intended, this approach generally fails to fi nd any true performance bot- tlenecks. Without a profi ling tool to help locate bottlenecks, blind optimization only wastes time, as shown in the graphic below.

Figure 1: Blind optimization is a time waster

Simply choosing to not optimize code is a bad idea as well. No end user will want to make a slow application part of their daily life. If they become frustrated enough, they’ll start looking for an alternative application. Disgruntled users often voice their opinions on blogs and other message boards, steering potential clients away from one company’s products to another. That kind of damage to a company’s reputation can be irreparable, and can cost the company countless dollars in lost revenue. Profiler Use Challenges

Despite clear benefi ts, programmers have been slow to adopt profi ling tools. They complain that traditional profi lers are invasive and diffi cult to use. In some cases, pro- grammers have found that certain profi lers added so much overhead to application execution that performance data was skewed. Those profi lers actually contributed to the problem instead of solving it. www.automatedqa.com

4 Detailed Reporting Multiple Measurements Ease ofUse Profiling Impact Minimal Low Integrated Impact, Profiling Tool tools are highly invasive to an application’s code; they may actually require the code the require actually may application’sthey an code; to invasive highly are tools profiling Some possible. as non-invasive as that’s profiler a select to important It’s precise andaccuratemeasurementsofyourcode’s performance. The ideal profiling tool integrates smoothly into your development process and allows and trulydoesspeeduptheoptimizationprocess. predecessors, their of limitations the of many to subject not is profilers of generation Recently, however, a new generation of profiling tools has begun to emerge. This latest what’s relevant. only show to filtered be can data the that so enough flexible be still yet needs, oper devel a information the all providing robust, be to needs system reporting the more, What’s interpret. to easy be to needs data the documents, WordMicrosoft or pages HTML outputs profiler the fashion. Whether easy-to-understand detailed, a in mation infor that report can it unless worthless is profiler a by generated information the All developers haveampletimetorunthem. ensure to intuitive, easy,and fast, be measurements various these between switching ing system resource usage, and overall application performance. It’s also essential that operat allocation, memory as such factors; of number a to regard with well performs code his certain be can developer a that ensures tool profiling versatile a such Having An ideal profiler would allow a developer to profile his code in several different ways. to beginusingitimmediately. down further. Such a tool should have a minimal learning curve, and allow developers it bog not lifecycle, software the up speeds that something be to meant is profiler A cations in less time, developers don’t have time to configure overly complicated tools. appli performance ists. high create to demand Additionally,increased the of because ex solution easier an if see to elsewhere look to he’sgoing action, simple a perform to commands of set complex a needs user a If code. their in problems performance diagnose easily and quickly to them allows that profiler a select should Developers introduce somuchoverheadthattheapplicationresponsetimeisimpacted. The profiler you choose should not require any changes in source code, and should not may beinjectingproblemsintotheapplication. itself tool profiling the if question to tend people many happens, that code. When her source-modification tool. Once this takes place, a developer no longer has control over sult in hundreds or thousands of changes in the code, it has to be done by an automated be modified so that the profiler can take accurate measurements. Because this could re How to ChooseaCode Profiling Tool ------

 www.automatedqa.com How to Choose a Code Profiling Tool

AQtime: AutomatedQA’s Profiling Optimization Solution

AQtime is AutomatedQA’s award-winning performance profiling and memory and re- source debugging toolset for Microsoft, Borland, Intel, Compaq and GNU compilers. AQtime includes dozens of productivity tools that help users easily isolate and elimi- nate performance, memory and resource issues within their code. AQtime is built with one key objective - to help users completely understand how their programs perform during execution. Using its integrated set of performance and debugging profilers, AQtime collects crucial performance and memory/resource allo- cation information at runtime. It then delivers its profilers’ results both in summarized and detailed forms. In short, AQtime provides you with all of the tools you need to begin the optimization process, and provides the following advantages: Minimal Intrusiveness AQtime never modifies source code. In fact, it always uses the least intrusive method to achieve the requested results. Since one normally expects results to refer to func- tions or sections of code, most AQtime profilers require only that the application be compiled with debugger information, so that code points can be linked to function or unit names. Easy to Use Interface Developers don’t need to learn complex shell commands or proprietary programming languages to profile code with AQtime. It sports an intuitive interface that was designed with the busy programmer in mind. With just a few clicks, a developer can isolate per- formance or resource issues in a fraction of the time that other tools take. What’s more, AQtime can function stand-alone or integrate directly into Microsoft Visual Studio or Borland Developer Studio. This feature provides you with the full AQtime functional- ity without leaving your IDE of choice. You can create and manage AQtime projects, profile your applications and view profiling results directly from the IDE. AQtime extends the Visual Studio and Borland Developer IDEs in the following ways:

Context Sensitive Profiling Right click in the Visual Studio editor and select “Profile this method” or “Profile this class” to start a new profiling session. It’s easy and natural.

Inline AQtime Panels All AQtime panels - Setup, Report, Summary, Call Graph, Assistant, and others - be- come true Visual Studio/Borland Developer panels.

Add a New AQtime Project Type You can create AQtime projects or add them to an existing Visual Studio solution the same way that you create or add other VS/BDS projects; by using the Create Project www.automatedqa.com

 Easy to UnderstandReports ings. This summary clearly pin-points the sections of code that need to be optimized, be to need that code of sections the pin-points clearly summary ings. This find its of report summary a displays AQtime complete, is session profiling a Once items. tems. F1 context-sensitive Help is provided for all AQtime panels, dialogs and project sys Help BDS and VS the both the into integrated fully is system help The AQtime Fully Integrated into IDEHelpsystem and macrosthatuse AQtime’s objectmodel. interface). This allows third-party developers to create Visual Studio add-ins, wizards uct, AQtime provides program interfaces for its internals (for example, for the Projects tom add-ins, wizards, and work with macros. As a true Visual Studio-integrated prod cus create to ability the with users provides Visualof Studio model automation The Contributing to the Visual Studio Automation Model frequently useditems,suchasRun,SelectProfiler, etc. most the contains toolbar This IDEs. both to toolbar AQtime the adds also AQtime theRun to menu. is added command Profiling with Run a Studio, Developer Borland In menu of AQtime’s projectnodeintheSolutionExplorer. context the through available also are and menu, Project the to added Assembly,are In Visual Studio, project-specific commands, such as Add Module, Add Output or Add profiling mode, modifytheprofilerandpaneloptions,etc. the select as well as profiling, resume and pause start, you let that com mands contains menu This menu. main IDE’s the to menu Profile the adds AQtime AQtime and Menu Toolbar Integration Developer Studio. Borland of dialog Items New the or Studio, Visualof dialogs Project New Add and integrated into Visual Studio Figure 2:AQTime menus How to ChooseaCode Profiling Tool Figure menus 3:AQtime integrated into Borland Developer Studio into Developer Borland - - - - -

 www.automatedqa.com How to Choose a Code Profiling Tool

allowing developers to quickly zero in on pain points in their code. The information shown is specific to the profiler that was run, so only relevant data is displayed. A more in-depth report is also available, allowing users to view detailed information for indi- vidual methods. Once generated, these reports can be stored as XML, HTML or TXT.

Figure 4: A sample report generated by AQtime

Support for a Multitude of Environments AQtime supports a wide range of Windows versions including Windows 98, ME, 2000, NT 4.0, XP, Windows 2003 Server and Vista. Additionally, AQtime supports 32 and 64-bit chipsets from both AMD and Intel. Support for a Wide Array of Languages AQtime can profile code written in a wide variety of languages, including:

• Microsoft Visual C# • Borland Delphi for .NET • Microsoft Visual Basic • Borland Delphi 2005 • Microsoft Visual J# • Intel C++ • Microsoft C++ • GNU Compiler Collection • Borland C# Builder • Compaq Visual Fortran

A Variety of Metrics AQtime boasts ten different profiler mechanisms which can be configured in several different ways. The end result is a flexible solution that allows users to easily ascertain

www.automatedqa.com those areas of most concern. The following profiler mechanisms are supported:

 Fast ROI peace ofmindforadevelopment team’s performanceconcerns. ensure to steps simple of series a and UI clean a just follow, to steps configuration clunky no time, ramp-up lengthy There’sno painless. to painful from change diately intuitive interface and easy to understand reports, the optimization process can imme an to Thanks AQtime. running of minutes within problems performance correct and AQtime can be put to work immediately. Many users say that they were able to isolate training, extensive require and curve learning steep a have which tools, some Unlike in bytes,allthepossiblecodebranchesanapplication,and more. formation is exposed, such as the number of loops in a routine, the size of the routines mance by analyzing debugging information or metadata. In doing this, a wealth of in Profiler - Analysis Static ables tracinglinksbetweenmethodsandfunctionswithoutrunningtheapplication. en This calls. function of diagram UML-style a builds then and application your in made, allowing for faster debugging of code. It analyzes the sequence of function calls Sequence Diagram Link Profiler - de-allocations andcallstoresourcemanagementroutines. appropriately.resources those releases and rectly and allocations resource monitors It - Profiler Resource can workonaspecificoperatingsystem. - Profiler Compliance Platform loaded andunloaded. were they times many how and application profiled the by unloaded and loaded were cantly slow down an application. This profiler determines what dynamic link libraries Tracer - Profiler Library Load order inwhichtheroutinesarecalledduringapplicationruntime. the and route the investigates It followed. being is path code efficient most the sure Function TraceFunction - Profiler plicable) outputsexceptiontraceinformation. ap (if and execution application the monitors It circumstances. given for displayed - Profiler TraceException run andhowanytimesitwasexecuted. profiler the during executed was line a or routine a whether determines It tested. and Coverage Profiler - runtime. during applications 64-bit and 32-bit in use memory the tracing by this does It erly. AllocationProfiler - and tracesthecallhierarchyonathread-by-threadbasis. their debugging. It monitors all of the method calls in an application, counts the calls, - Profiler Performance How to ChooseaCode Profiling Tool Checks to see if the application creates Windows resources cor resources Windows creates application the if see to Checks Lets you know how much of your code is actually being executed Helps you determine if an application is releasing memory prop memory releasing is application an if determine you Helps This profiler helps find poor performing functions and aids in aids and functions performing poor find helps profiler This Exposes routines that may not be written for optimal perfor optimal for written be not may that routines Exposes Shows what code is called and when, allowing you to make to you allowing when, and called is code what Shows Lets you confirm that the appropriate error messages are messages error appropriate the that confirm you Lets Loading and unloading dlls multiple times can signifi can times multiple dlls unloading and Loading Lets you determine whether the profiled application profiled the whether determine you Lets Generates a graphical map of how function calls are ------

 www.automatedqa.com How to Choose a Code Profiling Tool

Cost Effective

AQtime’s pricing model is incredibly cost effective. Some other vendors charge up to five times more for products with fewer features than AQtime. This means an entire team of programmers can be outfitted with AQtime for the same price as one license for a competitor’s product. No other profiling application can claim so much function- ality for such a small price tag. Learn More

To take the first step toward a smoother optimization process, visit www.automatedqa. com/downloads/aqtime http://www.automatedqa.com/downloads/aqtime and down- load a free trial version of AQtime.”

About AutomatedQA

AutomatedQA offers software products and services for development and quality assurance projects worldwide. We create innovative, award-winning and affordable products for the entire lifecycle including TestComplete for and AQtime, a sophisticated performance and memory profiler. Automat- edQA has an impressive list of customers ranging from huge teams in the world’s larg- est organizations to progressive one-developer shops. www.automatedqa.com

10 References: 5 4 3 2 1 Amazon.com http://phx.corporate-ir.net/phoenix.zhtml?c=97664&p=irol-newsArticle&ID= Akamai http://www.akamai.com/html/about/press/releases/2006/press_110606.html BusinessWeek http://www.businessweek.com/1999/99_30/c3639021.htm STSChttp://www.stsc.hill.af.mil/crosstalk/2005/12/0512miller.html DigitalFocushttp://www.infoq.com/news/Digital-Focus-Unveil-Survey-2006 957221&highlight How to ChooseaCode Profiling Tool 11 www.automatedqa.com