On 26/06/2021 11:59 am, Andrew Rowley wrote:
On 25/06/2021 8:58 pm, Scott Chapman wrote:
If other platforms don't JIT as quickly or aggressively, or if their JIT compiler isn't as smart as IBM's then their results may not be the same. Similarly, if the IBM C compiler isn't as optimized as it is on other platforms, it might underperform.

I don't know how long it takes for JIT to optimize the loop, 5 seconds is a lot of passes and in CPU terms is a very long time so it's not surprising that it is pretty good. The original Java code ran for 10 seconds. I reduced it to 5 to match the C++ implementation. I was expecting a performance reduction due to warm up time but it wasn't noticeable. The timing starts after the Java code is running so JVM startup is not measured.

I think the C++ compiler/library is a large part of it. On other platforms vector<bool> was apparently a big performance improvement, on z/OS removing it was a big improvement. So if there is something smart happening there on other platforms, there might be something not so smart on z/OS. xlclang++ might recover that performance.

I think the C++ code is sub-optimal. The PrimesC code is 5x faster than Java so if I were to compile that code with the C++ compiler would it qualify as C++?

FWIW, I'm happy that Java stacks up so well on z/OS as I'm pretty much coding 90% on the JVM these days. IBM have done a brilliant job optimizing. But these bench tests are more about comparing implementations of algorithms then equivalent implementations in different programming languages.



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to