Performance comparison from Delphi 6, 7, 2007, XE4 and XE6
Since there was recently some articles about performance comparison between several versions of the Delphi compiler, we had to react, and gives our personal point of view.
IMHO there won't be any definitive statement about this.
I'm always doubtful about any conclusion which may be achieved with such kind of benchmarks.
Asking "which compiler is better?" is IMHO a wrong question.
As if there was some "compiler magic": the new compiler will be just like a new laundry detergent - it will be cleaner and whiter...
Performance is not about marketing.
Performance is an iterative process, always a matter of circumstances, and implementation.
Circumstances of the benchmark itself.
Each benchmark will report only information about the process it measured.
What you compare is a limited set of features, running most of the time an idealized and simplified pattern, which shares nothing with real-world process.
Implementation is what gives performance.
Changing a compiler will only gives you some percents of time change.
Identifying the true bottlenecks of an application via a profiler, then changing the implementation of the identified bottlenecks may give order of magnitudes of speed improvement.
For instance, multi-threading abilities can be achieved by following some simple rules.
With our huge set of regression tests, we have at hand more than 16,500,000 individual checks, covering low-level features (like numerical and text marshaling), or high-level process (like concurrent client/server and database multi-threaded process).
You will find here some benchmarks run with Delphi 6, 7, 2007, XE4 and XE6
under Win32, and XE4 and XE6 under Win64.
In short, all compilers performs more or less at the same speed.
Win64 is a little slower than Win32, and the fastest appears to be Delphi 7, using our enhanced and optimized RTL.
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
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
When testing the FreePascal
compiler, we found out that its generated code is slightly slower than
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.