÷

 Step 1 : Are the Java 6 -server programs faster? At a glance.

This chart shows 3 comparisons - Time-used, Memory-used and Code-used.

Each chart bar shows, for one unidentified benchmark, how much the fastest Java 6 -server program used compared to the fastest C++ GNU g++ program.


 Step 2 : Are the Java 6 -server programs faster? Approximately.

This table shows 3 comparisons - Time-used, Memory-used and Code-used.

Each table row shows, for one named benchmark, how much the fastest Java 6 -server program used compared to the fastest C++ GNU g++ program.

 Java 6 -server used what fraction? used how many times more? 
Benchmark Time Memory Code Reduced N
 sum-file1/212×±
 spectral-norm±11×±
 n-body±12×±
 chameneos-redux±12×±
 mandelbrot±12×1/2
 nsieve±±
 fasta±12×±
 pidigits±±
 nsieve-bits±±
 regex-dna±1/2
 fannkuch±11×±
 binary-trees±
 k-nucleotide±
 partial-sums10×±
 reverse-complement±
 recursive12×±

± read the measurements and then read the program source code.

 Step 3 : Are the Java 6 -server programs faster? Measurements.

This table shows 5 measurements - CPU Time, Elapsed Time, Memory, Code and ~ CPU Load.

For each named benchmark, measurements of the fastest Java 6 -server program are shown for comparison against measurements of the fastest C++ GNU g++ program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ~ CPU Load
 sum-file 
Java 6 -server4.109,972226  
C++ GNU g++6.47852260  
 spectral-norm 
Java 6 -server24.0110,008514  
C++ GNU g++23.84900442  
 n-body 
Java 6 -server14.7511,5241424  
C++ GNU g++14.629321705  
 chameneos-redux 
Java 6 -server17.5112,0921429  
C++ GNU g++16.691,0041729  
 mandelbrot 
Java 6 -server3.2411,092623  
C++ GNU g++3.028961097  
 nsieve 
Java 6 -server2.2520,592296  
C++ GNU g++2.085,764313  
 fasta 
Java 6 -server21.469,1841240  
C++ GNU g++18.727881248  
 pidigits 
Java 6 -server1.928,992938  
C++ GNU g++1.661,052652  
 nsieve-bits 
Java 6 -server5.0413,364523  
C++ GNU g++3.863,316494  
 regex-dna 
Java 6 -server7.8175,892921  
C++ GNU g++5.5812,7041588  
 fannkuch 
Java 6 -server11.058,884555  
C++ GNU g++7.78844554  
 binary-trees 
Java 6 -server6.8926,808603  
C++ GNU g++4.476,996541  
 k-nucleotide 
Java 6 -server15.8970,9641052  
C++ GNU g++7.469,3041380  
 partial-sums 
Java 6 -server9.158,488474  
C++ GNU g++4.05852531  
 reverse-complement 
Java 6 -server1.3058,932592  
C++ GNU g++0.5413,288810  
 recursive 
Java 6 -server6.7612,044427  
C++ GNU g++2.401,008566  

 Measurements for all the accepted programs

 Java 6 -server : ubiquitous jit server virtual machine 

java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Server VM (build 10.0-b23, mixed mode, sharing)

Home Page: http://java.sun.com/j2se/

Download: http://java.sun.com/j2se/downloads/

"Remember how HotSpot works. It starts by running your program with an interpreter. When it discovers that some method is "hot" -- that is, executed a lot, either because it is called a lot or because it contains loops that loop a lot -- it sends that method off to be compiled. After that one of two things will happen, either the next time the method is called the compiled version will be invoked (instead of the interpreted version) or the currently long running loop will be replaced, while still running, with the compiled method. The latter is known as "on stack replacement" and exists in the 1.3/1.4 HotSpot based systems."

Benchmarking the Java HotSpot VM

Revised BSD license