Delphi 6 compiler
Time elapsed for all tests: 35.38s
Delphi 7 compiler (with our enhanced RTL)
Time elapsed for all tests: 34.79s
Delphi 2007 compiler
Time elapsed for all tests: 36.04s
Delphi XE4 compiler
Time elapsed for all tests: 38.09s
Delphi XE6 compiler
Time elapsed for all tests: 37.53s
Delphi XE4 64 bit compiler
Time elapsed for all tests: 41.40s
Delphi XE6 64 bit compiler
Time elapsed for all tests: 40.87s
You can find details about those regression tests, as mORMot regression tests
text reports.
Or, even better, you can run all tests by
yourself.
This is not a definitive answer.
In short, for most real process, the Delphi compiler did not improve the
execution speed.
On the contrary, we may say that the generated executables are slightly slower
with newer versions.
The compiler itself is perhaps not the main point during our tests, but the
RTL, which was not modified with speed in mind since Delphi 2010.
Even if mORMot code by-passes the RTL for most of its process, we
can still see some speed regressions when compared to pre-Unicode versions of
Delphi.
In some cases, the generated asm is faster since Delphi 2007, mainly due to
function inlining abilities.
But we can't say that the Delphi compiler do generate much better code in newer
versions.
And we can assure you that the RTL is a true bottlenck: from our experiment,
Win64 process is only slightly slower than Win32, due to the fact that we
by-pass the RTL, and use our own set of low-level routines (including optimized
x64 asm in SynCommons.pas
).
When testing the FreePascal
compiler, we found out that its generated code is slightly slower than
Delphi.
Floating-point is much faster with FreePascal than with Delphi, but
for common code (like our framework regression tests), FreePascal is slightly
less efficient than Delphi.
But still perfectly usable in production, generating smaller executables, and
with better abilities to cross-platform support, and a tuned RTL.
So, is it worth upgrading?
Are newer versions of Delphi worth the price?
To be fair... Delphi compiler did not improve much since 10 years...
But just like GCC or other compilers!
The only dimension where performance did improve in order of magnitude is for
floating-point process, and auto-vectorisation of the code, using SSE
instructions. But for business code (like database or client-server process),
the main point is definitively not the compiler, but the algorithm. The
hardware did improve a lot (pipelining, cache, multi-core....), and is the main
improvement axis.
Feedback is welcome on our forum, as usual.