views:

3418

answers:

9

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.

+1  A: 

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.

mghie
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
+1  A: 

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.

Jim McKeeth
Thank you for that suggestion. I hadn't heard of SmartInspect before. It is about half the price of AQTime.
lkessler
SmartInspect is a logger. I don't see how this can be compared to a real profiler. Can you explain?
Lars Truijens
+4  A: 

I've been very happy with AQtime for profiling.

Nick Bradbury
+15  A: 

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. ;-)

François
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
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
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
There is a minor spelling error in the answer. "ReportMemoryLeakOnShutdown" should read "ReportMemoryLeaksOnShutdown" (at least in D2010).
conciliator
@conciliator. Indeed! In D2007 also. I fixed the typo. Thanks.
François
+6  A: 

Also take a Look at Eric Grange's Sampling Profiler

Mohammed Nasman
Sampling profilers never have done it for me, but thanks for our suggestion as it might be useful to some people.
lkessler
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.
Mike Dunlavey
+2  A: 

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.
RichardS
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
+3  A: 

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!

Gerry
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.
Mike Dunlavey
+1  A: 

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

lkessler
+8  A: 

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

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

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.