Saclay : Java versus C++

Left Up Right

Java versus C++

Saclay Version - Updated May 2000



Update
The benchmark used at Rungis has been ported to my new computer at Saclay and to my personnal computer at home. The application itself is presented in this page. It is a program based on numerical calculations. Two versions : one in C++ , the other in Java have been written.

Here are the results :

Linux
The programs were run on my new linux box. The time spent to solve the system is reported in the following table. Execution times are given in seconds. More details are given in the FAQ.
Test gcc gcj jdk bd/ibm kaffe towerj
Rungis 41 - 247/- 133 -
Saclay 1 30 91 55/36 142 79
Home 23 - 38/28 - -
Saclay 3 15.4 - 28.3/14.4 - -
  • gcc is the well known GNU C++ compiler. The version used was egcs-2.93.21. The optimisation flag was -O3
  • gcj is the new front end to egcs for java. The optimisation flag was -O2. The library libgcj was checked out on May 5 th 1999 from the Cygnus repository.
  • jdk bd is the Blackdown port to Linux of the Java Developper Kit. At Rungis no JIT was available for the jdk 1.1, at Saclay the jdk 1.2 comes with the Sun JIT.
  • jdk ibm is the IBM Linux version of the Java Developper Kit. New as of May 2k.
  • kaffe is a virtual machine designed to execute java bytecode; it performs "just-in-time" code conversion. The version used was 1b04.
  • TowerJ is a High Performance Java Compiler. The version tested was 3.0.0.


Windows
Then the computer was booted under Windows. and the java virtual machines freely available from the net were tested.
Test gcc vc++ hotspot jdk jview ibm
Rungis 57 39 - 33 44 -
Saclay 1 30 29 71 33 37 38
Home - 24 51 27 30 -
Saclay 3 15 14.7 19 17.6 16.5 14.1
  • gcc is the GNU C++ compiler ported to Windows by the GNU-Win32 Project.The version used was 20. The optimisation flag was -O3.
  • vc++ is the Microsoft Visual C++ compiler The optimization flag was /Ox.
  • hotspot is the long awaited performance engine for java. The first iteration lasts 41 s, the following 10 s. In classic mode each iteration lasts 8.3 s.
  • jdk is the windows port of the Sun Java Developper Kit. It uses the symantec JIT.
  • jview is the virtual machine provided in the SDK version 3.0 pre-release 1.
  • ibm is the virtual machine given by IBM with the jdk 1.1.7.


More links

The java packages can be directly downloaded : gauss.zip

Results for other popular platforms are also available.
In January 2k, a new series of measures has been done.

For discussion about benchmarking see this Q&A page from Sun.

The best report on Java performance is available in the Java Lobby.

This paper in JavaWorld presents the results of tests comparing java and C++.

The JavaNumerics page provides a focal point for information on numerical computing in Java.

James Gosling has written a paper about The Evolution of Numerical Computing in Java.




shelf