Calculating 50000 digits of Pi, computation time (in sec)
------------------------------32 bit----------------------------- 64bit
Delphi Rio ----------------35.019--------------------------- 33.791
Visual C/C++ ------------33.399----------------------------33.453
Oxygene/Island----------33.316----------------------------33.434
So the good news is: In the context of this limited testing, Oxygene/Island can generate equally (actually, slightly faster) optimized code as Visual C/C++!
The following is detailed story.
Attracted by the proud words from RemObject about its Island product and the ânative CPU powerâ, I acquired a personal version, with the goal to find out a performant native Pascal compiler for computationally-intensive scientific applications. Iâd like to know if Oxygene/Island fits.
Here are the test settings:
- Delphi Rio
- Island/Oxegene 10.0.0.2405
- Visual C/C++ 2017, with optimization switch favor faster code
- All test are compiled on Windows Server 2016 x64 OS.
- The testing code is based on the following Free Pascal code, which is trivially ported into Delphi, Oxygene/.NET, Oxygene/Island, and C respectively.
https://rosettacode.org/wiki/Pi#Pascal
For the computational performance, it is (loosely) assumed that Oxygene/Island should spit out better optimized code. than Delphi, given it is LLVM-based.
For Delphi and Island, the Win32 API QueryPerformanceCounter is used to measure time; while for Oxygene/.NET, the .NET stock StopWatch is used.
RESULTS:
1. Size of the executable:
Oxygene/Island (32bit)
- Debug Build: 1.54MB
- Release build: 526KB
Oxygene/.NET
- Debug Build: 90KB
- Release build: 90KB
Delphi Rio 10.3 (32bit)
- Debug Build: 963KB
- Release build: 59.5KB
Visual C/C++ (2017)
- Debug Build: 13KB
- Release build: 12KB
2. Computation time to calculate 50000 digits of Pi
Oxygene/Island
- **Release build: 33.316 sec (32bit) 33.434sec (64bit)
Oxygene/.NET
- Release build: 33.818 sec
Delphi Rio 10.3
- **Release build: 35.019 sec (32bit) 33.791(64bit)
Visual C/C++ (2017)
- **Release build: 33.3995 sec (32bit) 33.4529(64bit)
CONCLUSION - Oxygene Island 32bit build is about 5% faster than Delphi 32bit native code, but it generates almost 10x LARGER executable. When it comes to 64bit built, the difference is very small (~1%), 33.434 sec (Island) versus 33.791 sec (Delphi).
Also finally - Compiling Time (if you do care about it) - for this little program (< 80 lines)
Oxygene/Island compiling time: 4.29 sec
Delphi compiling time: 0.9 sec
Updated - for those interested, the little testing code is at this Gist link:
C/C++
Delphi
Oxygene/Island