Delphi Compiler Optimization Requests

Delphi Compiler Optimization Requests

We had to to calculate the hardware requirements for a large back end service written in Delphi. Of cause we already did a lot of optimization in all kind of areas (searching bottlenecks by AQTime, using FastMM4 switches for multithreading, switching from IndyServer to Microsoft Web Server API etc). This is our daily business and works.

But still I have the strange feeling that the service could run significantly faster if the win32 or mainly the win64 compiler would optimize better.

Scanning through RSP there are a lot of issues open (just a few examples):
https://quality.embarcadero.com/browse/RSP-9968: Poor code generation for double precision floating point return values (x86)
https://quality.embarcadero.com/browse/RSP-21519: Win64 compiler should optimize 5th and further arguments into registers
https://quality.embarcadero.com/browse/RSP-21222:
Exception handling prevents register usage

And specially for win64 I would expect to have some advanced compiler switches to optimize for enhanced CPU instructions as SSE / AVX
(e.g. https://blogs.msdn.microsoft.com/vcblog/2017/07/11/microsoft-visual-studio-2017-supports-intel-avx-512/)

But what happens with the the Delphi compiler in that areas ... not much and we continue to produce heat in the CPU instead of running the code faster.

Please add your open issues and suggestions in that area. I try to forward them to EMBT as a "business request".

Comments

  1. Once your bottlenecks are identified, rewrite them in C and use GCC, then link it statically. You won't find anything better. Or try to compile them with FPC - it can do wonders for floating point (especially when inlining), in respect to Delphi, even if the average code is slower on FPC than Delphi (less efficient register allocation - but they are working on it).
    For pure pascal code optimization, see https://www.slideshare.net/ArnaudBouchez1/high-performance-object-pascal-code-on-servers-at-ekon-22 - perhaps you may find some confirmations you went into the right direction!

    ReplyDelete
  2. As far as I can tell the top issues by vote on the bug list were addressed. If people want these issues addressed vote for them.

    ReplyDelete
  3. A. Bouchez I am using MS SDK cl.exe for the C stuff. Has the best performance.

    ReplyDelete

Post a Comment