Profiler and Memory Analysis Tools for Delphi [closed]
Asked Answered
N

12

54

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.

Newsreel answered 14/11, 2008 at 22:20 Comment(5)
Sorry, I have only experience with AQTime.Ory
Do you feel it is worth the expense?Newsreel
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... :-(Passional
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.Grapnel
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-changelogHighhat
P
35

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

Philemol answered 15/11, 2008 at 2:46 Comment(7)
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.Sumption
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.Newsreel
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.Newsreel
There is a minor spelling error in the answer. "ReportMemoryLeakOnShutdown" should read "ReportMemoryLeaksOnShutdown" (at least in D2010).Warrior
@conciliator. Indeed! In D2007 also. I fixed the typo. Thanks.Philemol
the gpProfiler source code is not available on that link anymore.Mantoman
For tracking the FastMM allocation, virtual memory graph, dump or the system information summary you may check the FastMM Usage Tracker, (+1)Semple
C
33

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.

Condom answered 14/11, 2008 at 22:20 Comment(2)
Thanks for your effort! I'll check it out!Keep
+1 and it works with multi-threaded appsMedicable
S
24

Also take a Look at Eric Grange's Sampling Profiler

Stannite answered 16/11, 2008 at 7:6 Comment(3)
Sampling profilers never have done it for me, but thanks for our suggestion as it might be useful to some people.Newsreel
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.Ambrosio
It is one of the best sampling tools available @ Eric Grange's well done keep it upYl
C
8

I've been very happy with AQtime for profiling.

Cochin answered 15/11, 2008 at 2:4 Comment(2)
If you have Enterprise or Architect version of RAD XE, AQTime lite edition is now included with Delphi.Esophagitis
It does both Memory and Time profilingMorganstein
A
4

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!

Amin answered 17/11, 2008 at 2:43 Comment(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.Ambrosio
U
3

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

Uticas answered 14/11, 2008 at 22:20 Comment(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/…Unremitting
P
2

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.
Puggree answered 16/11, 2008 at 10:42 Comment(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.Newsreel
N
2

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

Newsreel answered 20/11, 2008 at 1:27 Comment(0)
S
1

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.

Soprano answered 14/11, 2008 at 22:20 Comment(0)
P
1

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.

Passional answered 14/11, 2008 at 22:34 Comment(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...)Sumption
F
1

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.

Furnish answered 15/11, 2008 at 0:58 Comment(2)
Thank you for that suggestion. I hadn't heard of SmartInspect before. It is about half the price of AQTime.Newsreel
SmartInspect is a logger. I don't see how this can be compared to a real profiler. Can you explain?Morganstein
M
0

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.

Medicable answered 14/11, 2008 at 22:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.