54
votes

I recently upgraded from Delphi 4 to Delphi 2009. With Delphi 4 I had been using GpProfile by Primoz Gabrijelcic as a profiler and Memory Sleuth by Turbo Power for memory analysis and leak debugging. Both worked well for me. But I now need new tools that will work with Delphi 2009.

The leader in Profiling/Analysis tools for Delphi by a wide margin is obviously AQTime by AutomatedQA. They recently even gobbled up Memproof by Atanas Soyanov, which I understood was an excellent and free memory analysis tool, and incorporated its functionality into AQTime. But AQTime is very expensive for an individual programmer. It actually costs more than the upgrade to Delphi 2009 cost!

So my question is: Are there other less expensive options to do profiling and memory analysis in current versions of Delphi that you are happy with and recommend, or should I bite the bullet and pay the big bucks for AQTime?


Addenum: It seems the early answerers are indicating that the FastMM manager already included in Delphi is very good for finding memory leaks.

So then, are there any good alternatives for source code profiling?

One I'm curious about is ProDelphi by Michael Adolph which is less than one sixth the cost of AQTime. Do you use it? Is AQTime worth paying six times as much?


Addenum 2: I downloaded trial versions of both AQTime and ProDelphi.

AQTime was a bit overwhelming and a little confusing at first. It took a few hours to find some of the tricks needed to hook it up.

ProDelphi was very much like the GpProfile that I was used to. But its windows are cluttered and confusing and it's not quite as nice as GpProfile.

To me the big differences seem to be:

  1. ProDelphi changes your code. AQTime does not. Changing code may corrupt your data if something goes wrong, but my experience with GpProfile was that it never happened to me. Plus one for AQTime.

  2. ProDelphi requires you turn optimization off. But what you want to profile is your program with optimization on, the way it will be run. Plus one for AQTime.

  3. ProDelphi only can profile down to the function or procedure. AQTime can go down to individual lines. Plus 2 for AQTime.

  4. ProDelphi has a free version that will profile 20 routines, and its pro version costs less than $100 USD. AQTime is $600 USD. Plus 4 for ProDelphi.

The score is now 4-4. What do you think?


Addenum 3: Primoz Gabrijelcic is planning to get GpProfile working again. See his comments on some of the responses below. He on StackOverflow as Gabr.


Addenum 4: It seems like there may be a profiler solution after all. See Andre's open source asmprofiler, described below.

5
  • Sorry, I have only experience with AQTime. Nov 14, 2008 at 22:29
  • Do you feel it is worth the expense?
    – lkessler
    Nov 14, 2008 at 22:33
  • 2
    You should try the time-limited demo of AQTime. I had a lot of problems with it on my laptop which is set to 120 DPI - some dialogs were actually unusable because buttons were cut off. That did not inspire much confidence, and support said they couldn't do anything about it... :-(
    – mghie
    Nov 14, 2008 at 22:47
  • 1
    AQTime caused me some strange issues after it was installed automatically with Delphi XE2 Update 4. I had to uninstall AQTime to be able to use the most simple features of Delphi, such as "Complete Class at Cursor" wasn't working until I uninstalled AQTime. Mar 29, 2012 at 18:45
  • This is freeware and easy to use (compared with ProDelphi). It also goes down to line code precision. But I doubt the results in this case are accurate. delphitools.info/downloads/samplingprofiler-changelog
    – IceCold
    Feb 26, 2018 at 11:52

12 Answers 12

35
votes

For the price, you cannot beat FastMM4 as a memory tracker. It's simple to use yet powerful and well integrated with Delphi.
I guess that you know that, without downloading, installing or changing anything else, just putting this line

ReportMemoryLeaksOnShutDown := True;

anywhere in your code, will enable basic reporting of memory leaks.
If you need more like crash information, EurekaLog is a very good product that we use. MadExcept also has a good reputation...

For profiling specifically, we have AQTime.

As for gpProfile, you can try and bug gabr on SO for an update... or go and update gpProfile yourself as it is open source. ;-)

7
  • 3
    The current public source is terribly outdated. I have much newer version on my disk, but it is still very much in the 'work in progress' state and I'm not brave enough to display such broken code. I'm planning to put GpProfile on the Google Code as soon as it is at leat partially working again.
    – gabr
    Nov 15, 2008 at 8:59
  • Hello gabr! Didn't know you were still around, and I see you're especially active on StackOverflow. I've used your GbProfile very happily for almost 10 years with Delphi 4. Great product, and very advanced for the time. I've love to hear your answer to the question I've posted here.
    – lkessler
    Nov 16, 2008 at 5:58
  • 1
    p.s. Gabr: Your OmniThreadLibrary looks very interesting! I've never attempted threading because it always looked so complicated, but your library seems to make it very easy.
    – lkessler
    Nov 16, 2008 at 6:10
  • 2
    There is a minor spelling error in the answer. "ReportMemoryLeakOnShutdown" should read "ReportMemoryLeaksOnShutdown" (at least in D2010). Aug 9, 2010 at 14:40
  • 4
    For tracking the FastMM allocation, virtual memory graph, dump or the system information summary you may check the FastMM Usage Tracker, (+1)
    – TLama
    Jan 18, 2012 at 14:06
33
votes

I've made an open source profiler for Delphi: http://code.google.com/p/asmprofiler/

It's not perfect, but it's free and open source :-).

The main reason I made it was because I missed an exact call tree. For example, ProDelphi only stores a summary and total counts of all calls, you cannot see what calls a specific procedure at a specific time did (or time duration). And it has a time chart, so you can see how the call duration changed over time.

2
  • Thanks for your effort! I'll check it out!
    – Edwin Yip
    Feb 20, 2012 at 5:48
  • 3
    +1 and it works with multi-threaded apps
    – mjn
    Mar 16, 2012 at 6:18
24
votes

Also take a Look at Eric Grange's Sampling Profiler

3
  • 2
    Sampling profilers never have done it for me, but thanks for our suggestion as it might be useful to some people.
    – lkessler
    Nov 16, 2008 at 17:52
  • 1
    The problem is, they don't sample enough info. If they capture the whole call stack they can tell you which call instructions are costing you the most. It's more important to do that than to get high precision from a really large number of samples. Nov 20, 2008 at 2:04
  • 2
    It is one of the best sampling tools available @ Eric Grange's well done keep it up Nov 11, 2011 at 5:55
8
votes

I've been very happy with AQtime for profiling.

2
  • 1
    If you have Enterprise or Architect version of RAD XE, AQTime lite edition is now included with Delphi.
    – Warren P
    Jun 27, 2011 at 20:02
  • It does both Memory and Time profiling Mar 15, 2012 at 15:55
4
votes

Having used both GpProfile and AQTime I have found both to be effective at finding what method call is causing a bottle neck.

However AQTime can also tell me what line of code is causing this, without making any changes to my source code (although it works best with TD32 debugging and debug dcus).

I recently used it to speed up a routine by about 30x (due to bad use of a internal library function)

However I didn't have to pay for it myself!

1
  • 1
    30x is not unusual if you can get instruction-level cost. I do it by hand, by halting with a pause key a few times and recording the call stack. If some call is wasting 29 out of 30 cycles, you don't need 1000 samples to see it. Nov 20, 2008 at 1:54
3
votes

We use AQTime Pro and are happy with it. Smartbear have recently released a completely free AQTime standard edition. Most of the features are still there but they have of course removed a bit

1
  • 1
    The two pages linked here have been removed and now redirect to AQtime Pro. It looks like the Standard Edition is no longer available (and no longer bundled with RAD Studio). Here's a page about the free edition included in earlier versions of RAD Studio: support.smartbear.com/more-info/aqtime/… Mar 15, 2019 at 11:17
2
votes

I agree with you about the interface of ProDelphi, but it does a good enough job that we're happy to stay with it. We only need to profile very occasionally when we have a significant performance issue, and it's always helped us find the problem pretty quickly. Very good value for money, and Michael seems pretty good about keeping it updated for new versions.

One thing I would suggest is that because it does require code to be inserted, having all the relevant code in some kind of VCS is invaluable. When we need to profile, we:

  • Check all relevant files in
  • Check them all out
  • Do the profiling we need, then
  • Cancel all checkouts, effectively rolling back to where we were.
1
  • A VCS in my case is overkill. What I do is copy my entire working directory to "copy of" the same directory. Then it is trivial for me to get back. I actually do that for every significant change I might be making.
    – lkessler
    Nov 16, 2008 at 17:51
2
votes

Has anyone tried the Profiler component at Delphi Area? It is freeware with source and it's writeup says:

If you are looking for an easy and accurate way to measure execution time of your code for free, TProfiler is what you need. TProfiler is a non-visual and debugging component that enables you to create named timers in your code.

Each timer of TProfiler provides the following information:

The number of times that the timer was activated (Hit Count) The total execution time The average execution time on each hit Execution time on the first hit Execution time on the last hit The hit with minimum execution time The hit with maximum execution time

1
vote

It's true, for profiling I miss Primoz' GpProfile, and haven't found a good replacement. I once tried AQTime, but wasn't too happy with it for the price.

For tracking of memory leaks and dodgy memory accesses however I couldn't be happier than I am with FastMM4.

1
  • 1
    I promise I'll work on a new release harder! I miss GpProfile too (and luckily it looks like I'll need it soon...)
    – gabr
    Nov 15, 2008 at 8:57
1
vote

I've been using ProDelphi for a long time & find it meets my needs.

I've been able to achieve stunning results in system performance improvements by using the data it provides.

For small projects the free version is fine.

For larger projects, you'll need the (Paid) pro version.

1
vote

For a profiler you might try SmartInspect from Gurock Software. I never used GpProfile, but quickly glancing at its feature set reminded me of SmartInspect. Interestingly it doesn't claim to be a profiler, but it seems to be as much of one as GpProfile (unless I am missing something). It supports Delphi 2009 and has a free Trial and is a little cheaper then AQTime.

Note: SmartInspect is a logger rather than a profiler.

2
  • Thank you for that suggestion. I hadn't heard of SmartInspect before. It is about half the price of AQTime.
    – lkessler
    Nov 15, 2008 at 3:19
  • 8
    SmartInspect is a logger. I don't see how this can be compared to a real profiler. Can you explain? Nov 15, 2008 at 9:29
0
votes

The FastMM4 memory manager mentioned in this older answer ("How to monitor or visualize memory fragmentation of a delphi application") keeps a list of all allocations which can be queried at run time (and displayed in a grid using the included demo application). It does not exactly show which object leaks, as the statistics are per block size. But it can be useful for long-time monitoring of applications in production, for example servers or services. I am currently integrating it in a (commercial) web application server framework as the 'VisualMM' add-on.

Not the answer you're looking for? Browse other questions tagged or ask your own question.