÷

 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
 n-body±16×±
 spectral-norm±13×±
 fannkuch±12×±
 mandelbrot±
 fasta15×±
 pidigits±
 regex-dna1/2
 binary-trees±
 reverse-complement1/4
 chameneos-redux14×±
 k-nucleotide1/2

± 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
 n-body 
Java 6 -server25.0525.0812,4121424  1% 0% 0% 100%
C++ GNU g++23.8123.817881428  0% 1% 0% 100%
 spectral-norm 
Java 6 -server15.9115.9312,564950  0% 0% 0% 100%
C++ GNU g++11.9411.941,0041114  0% 0% 1% 100%
 fannkuch 
Java 6 -server66.7966.8313,7961150  0% 0% 0% 100%
C++ GNU g++50.0150.011,1241186  0% 0% 0% 100%
 mandelbrot 
Java 6 -server41.5641.5748,900903  0% 0% 0% 100%
C++ GNU g++24.5524.5530,564858  0% 0% 0% 100%
 fasta 
Java 6 -server7.507.5112,2481240  0% 0% 0% 100%
C++ GNU g++3.763.778161470  0% 0% 0% 100%
 pidigits 
Java 6 -server5.475.4714,828938  1% 3% 0% 100%
C++ GNU g++2.712.711,596682  0% 0% 1% 100%
 regex-dna 
Java 6 -server29.3529.37689,108929  0% 0% 0% 100%
C++ GNU g++14.1914.19100,3321759  0% 0% 0% 100%
 binary-trees 
Java 6 -server28.2128.35255,460603  0% 0% 0% 99%
C++ GNU g++13.4713.47148,652892  0% 0% 0% 100%
 reverse-complement 
Java 6 -server2.862.90473,280592  0% 1% 0% 99%
C++ GNU g++1.121.12245,4322275  1% 0% 1% 100%
 chameneos-redux 
Java 6 -server12.4512.4717,8761429  0% 0% 0% 100%
C++ GNU g++4.024.021,2441606  0% 0% 0% 100%
 k-nucleotide 
Java 6 -server46.9046.95351,0041602  0% 0% 0% 100%
C++ GNU g++13.6113.61132,8643415  0% 0% 0% 100%

 Measurements for all the accepted programs

 Java 6 -server : ubiquitous jit server virtual machine 

java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode)

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