Dave Plummer has a series of Software Drag Racing videos, using a
program to search for prime numbers as a simple speed test for different
languages and/or hardware. The "drag race" description acknowledges that
it isn't a comprehensive benchmark, just a test of speed at one
particular simple task.
I thought it would be fun to try it on z/OS. I modified the C++ version
to compile on z/OS, and there was a Java version that ran without
modification.
Results were interesting.
- Java was much faster than C++ on z/OS. I modified the C++ version to
change the vector<bool> to a byte/bit array (as was used in his first
version) and performance was much better. However it still only matched
Java, it didn't beat it. On other platforms C++ was much faster than
Java e.g. 15-50%, maybe more.
- 31 bit code was about 10% faster than 64 bit, for both C++ and Java.
I configured my zIIP offline to make sure the Java code was running on a
regular CP.
I'm interested to know why C++ didn't outperform Java. C++ isn't my
language, so I might be missing something obvious. Any ideas?
Software Drag Racing video:
https://www.youtube.com/watch?v=l1j-aF_wyzU
C++ to run on z/OS:
https://github.com/andrew890/Primes/tree/drag-race/PrimeCPPzOS/solution_1
Java version:
https://github.com/andrew890/Primes/tree/drag-race/PrimeJava/solution_1
--
Andrew Rowley
Black Hill Software
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN