- Mastering Delphi Programming:A Complete Reference Guide
- Primo? Gabrijel?i?
- 624字
- 2021-06-24 12:33:30
AQTime
AQTime is a performance and memory profiler for C/C++, Delphi, .NET, Java, and Silverlight, produced by SmartBear Software. It supports 32- and 64-bit applications and can be found at www.smartbear.com.
Previously, a special Standard version of AQTime was included with RAD Studio, C++Builder, and Delphi. This offer was only available for releases XE to XE8 and the licensing was not renewed after that. If you want to use AQTime with any other Delphi release, you have to buy AQTime Professional.
For testing purposes, you can install a trial version of AQTime Professional, which will only allow you to run five profiling sessions. Dedicate some time to testing and use your five sessions wisely!
AQTime Professional supports all Delphi version from 2006 to Tokyo and you can even use it in Visual Studio, which is a great plus for multiplatform developers. It contains a variety of profilers—from the performance profiler (binary instrumentating profiler) and the sampling profiler, to the coverage profiler (to see which parts of the program were executed) and more specific tools such as BDE SQL profiler, static analysis (a code analysis tool which is not really a profiler), and more.
It integrates nicely into the Delphi IDE but you can also use it as a standalone application. That gives you more flexibility during the profiling and result analysis and that's why I also used the standalone AQTime Professional for the examples.
To prepare your program for profiling, make sure that the following compiler options are set:
- Compiler, Stack frames = on
- Compiler, Debug information = Debug information
- Compiler, Local symbols = true
- Linker, Debug information = true
In order for AQTime to be able to find the source file for your project, you have to specify a search path. Go to Options | Options, then select General | Search directory, and add all the folders with your source files.
Next you can choose to profile all units, but unless you are using a sampling profiler this will slow down the execution in a typical program a lot. It is better to select just a few units or, as in our example, just a few methods.
The easiest way to do that is to create a new profiling area and the easiest way to do that is to select one or more methods in the left tree (use Shift+click and Ctrl+click), then right-click and select Add selected to | New profiling area. After that you can add additional methods to that profiling area by right-clicking and selecting Add selected to | Existing profiling area, or simply with drag-and-drop.
When creating a new profiling area, you also have to choose whether to profile on a method or on a line level by checking or unchecking the Collect info about lines checkbox:

Then start the program from AQTime—or select the AQTime | Run with profiling menu from Delphi, do the necessary steps you want to profile, and exit. AQTime will show the profiling results. Similarly to all other profilers, it will show a grid with measured methods, net time spent in each, time with children, and a hit count—an indicator showing how many times the method executed.
More interesting info is hiding in the lower panel. There is a very detailed Call Graph, which displays a call tree for the selected method, and a very useful Editor panel, which shows the source together with the hit count information for each line:

AQTime is a great tool provided that you stay away from the very limited Standard edition and go directly for the Professional.
- 電腦軟硬件維修大全(實例精華版)
- 電腦組裝與維修從入門到精通(第2版)
- The Applied AI and Natural Language Processing Workshop
- Apple Motion 5 Cookbook
- Creating Flat Design Websites
- 電腦高級維修及故障排除實戰
- 筆記本電腦維修實踐教程
- BeagleBone Robotic Projects
- LPC1100系列處理器原理及應用
- FL Studio Cookbook
- FPGA實驗實訓教程
- The Deep Learning with PyTorch Workshop
- 計算機組成技術教程
- Corona SDK Mobile Game Development:Beginner's Guide
- 分布式存儲系統:核心技術、系統實現與Go項目實戰