Re: Delphi 7 vs 2007



Bob D. wrote:

Hello,

I have a project written in Delphi 7.
I want to ask, if I move to Delphi 2007 will I have any benefit to
the generated executable file? I mean does the compiler has any
change or improvement?

Others already pointed out that you will get better performance just by
rebuilding your project with the latest compiler.

1) FastMM Memory Manager

There is a new memory manager, which is faster (especially in
multi-threaded apps) and less susceptible to fragmentation. It's also
been pointed out that you can use this without upgrading. You just
need to make sure you distribute the right sharemem if you're using
packages and be careful about load order if you're using exception
loggers like MadExcept.

In fact, I'd suggest getting the latest FastMM, even if you do upgrade.
Pierre releases fixes and improvements fairly regularly, and the full
package has more debugging/leak detection options than the one that
ships with Delphi.

http://sourceforge.net/projects/fastmm/

There is something you need to watch out for. FastMM is less tolerant
of memory bugs than the previous one. Your existing application might
access freed memory and happen to work by accident, but you will see an
exception using FastMM. I consider this to be a good thing since these
are legitimate bugs in my code, which usually only show up as random
failures. Still, I'd do some testing before releasing anything.


2) FastCode routines in the RTL

You can use the FastCode routines without upgrading, too. In fact,
they have a lot that hasn't been included in Delphi, at least not yet.

http://www.fastcodeproject.org/

If you use the FastCode libraries and call the routines directly, only
these direct calls from your code will get the benefit. The VCL and
RTL will still use the default routines. You can get around this by
rebuilding the VCL/RTL or by patching the to redirect all calls to
their FastCode equivalents if you're comfortable with these.

With Delphi 2007, you don't have to worry about any of this. All of
the replaced routines are used everywhere in (and tested with) the
VCL/RTL.


3) Inlining

If a routine is small enough, removing the calling overhead and
including the code inline gives you a performance increase. the
tradeoff is increased application size. This is used generously
throughout the VCL/RTL.


4) Miscellaneous

And, of course, there have been lots of little tweaks and fixes in the
VCL/RTL/Compiler.

One example I found was the use of MOVZX in the compiler which gives
slightly smaller and faster code generation on P3/P4 and up at the
expense of slightly slower code on older processors.


These are just the things that will affect the generated EXE and
doesn't include other improvements and fixes in the compiler, VCL, RTL,
IDE, help, unit testing, modelling, build system, etc.

The link Dan Downs posted covers a lot of these in better detail.

--
Regards,
Bruce McGee
Glooscap Software
.



Relevant Pages

  • Re: Calling a "procedure of object" routine w/variable parameters
    ... > Which calling convention are you using for your routines? ... > due to the way cdecl functions put parameters on the stack. ... Basically a Delphi routine is called from C, ...
    (borland.public.delphi.language.basm)
  • [QC48712] Help system: No top entries in Reference for RTL routines (Categorical Routines Listing)
    ... The organization of the rich set of RTL routines Delphi offers makes it very ... by no way a complete reference covering the whole, ...
    (borland.public.delphi.non-technical)
  • Re: Download Fastcode Redux
    ... So if I track all the QC reports that you have made ... then I see many of them are suggested FastCode additions to Delphi. ... So if one selected all such accepted routines, one could in effect make an RTL ... for an earlier Delphi with all the FastCode enhancements to D2006? ...
    (borland.public.delphi.language.basm)
  • Congratulations to Dennis and John
    ... top contributors to the Delphi FastCode Project in 2004. ... The FastCode Project sets up challenges for folks to write replacement ... routines for the Delphi RTL with better performance than the stock routines. ... Congratulations John and Dennis! ...
    (borland.public.delphi.language.basm)
  • Re: Visual Basic to Delphi - Yes or No?
    ... >> the world of Delphi, VCL, etc, and how to do in Delphi all ... No need wasting bandwidth in the documentation on advantages. ... map to system routines and return OS file handles, not normal Delphi file ...
    (borland.public.delphi.non-technical)