/mobile Handheld Friendly website

÷

 Step 1 : Are the Java 7 averaged programs faster? At a glance.

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

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


Look at speed another way - look at a box plot of Time-used data.

 Step 2 : Are the Java 7 averaged programs faster? Approximately.

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

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

 Java 7 averaged used what fraction? used how many times more? 
Benchmark Time Memory Code
 binary-trees±±
 n-body±24×±
 mandelbrot±14×±
 fannkuch-redux±17×±
 spectral-norm46×±
 pidigits76×
 Java 7 averaged used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±±±

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

 Step 3 : Are the Java 7 averaged programs faster? Measurements.

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

For each named benchmark, measurements of the fastest Java 7 averaged 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
 binary-trees 
Java 7 averaged17.978.19876,8081078  50% 55% 57% 58%
C++ GNU g++28.778.82353,660892  96% 49% 93% 92%
 n-body 
Java 7 averaged22.3722.3717,6921498  0% 100% 0% 0%
C++ GNU g++19.6219.637441659  0% 0% 0% 100%
 mandelbrot 
Java 7 averaged31.988.02455,892874  100% 100% 100% 100%
C++ GNU g++24.476.1532,2201017  100% 100% 100% 100%
 fannkuch-redux 
Java 7 averaged68.7317.3518,7121345  99% 99% 99% 99%
C++ GNU g++49.9312.801,1281440  99% 100% 97% 97%
 spectral-norm 
Java 7 averaged17.354.3949,5281027  99% 99% 99% 99%
C++ GNU g++10.042.521,0761044  100% 100% 100% 100%
 pidigits 
Java 7 averaged7.664.21119,8801851  13% 77% 78% 6%
C++ GNU g++2.292.301,584682  94% 6% 0% 1%
 fasta 
No program
C++ GNU g++0.070.07?1266  0% 100% 0% 0%
 fasta-redux 
No program
C++ GNU g++0.030.03?1474  0% 25% 50% 0%
 k-nucleotide 
No program
C++ GNU g++0.240.10?3415  50% 50% 23% 100%
 reverse-complement 
No program
C++ GNU g++0.020.02?2275  0% 50% 0% 100%
 regex-dna 
No program
C++ GNU g++0.110.04?695  50% 50% 8% 100%

 Step 4 : Are there other Java 7 averaged programs for these benchmarks?

Remember - those are just the fastest Java 7 averaged and C++ GNU g++ programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Java 7 averaged.

Maybe one of those other Java 7 averaged programs is fastest on a different OS/machine.

 Step 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Java 7 averaged and C++ GNU g++ programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.

Maybe one of those other programs is fastest on a different OS/machine.

 Java 7 averaged : average of repeated measurements 

java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

The reported "Java 7 averaged" program CPU secs and program Elapsed secs are averages that approximate performance after "warm-up" - see Help: What about Java?

Each program performs the same calculation 66 times, for example -

   public static void main(String[] args){
      for (int i=0; i<65; ++i) binarytrees.program_main(args,false);
      binarytrees.program_main(args,true);
   }

The "Java 7 averaged" program CPU secs and program Elapsed secs measurements are made in the same way as all the other time measurements, but before display they are divided by 66 to give approximate averages that minimize the influence of mixed-mode method interpretation and on-stack-replacement, for example -

/usr/local/src/jdk1.6.0_25/bin/java -Xms256m -Xmx256m -server -XX:+PrintCompilation -XX:+PrintGC -XX:+TieredCompilation -XX:+AggressiveOpts nbody 50000000

     50   1      3  java.lang.String::equals (88 bytes)
---   n   java.lang.System::arraycopy (static)
     52   2      3  java.lang.String::hashCode (64 bytes)
     53   3      3  java.lang.String::charAt (33 bytes)
     53   4      3  java.lang.Object:: (1 bytes)
     56   5      3  java.nio.Buffer::position (43 bytes)
     56   8      3  java.nio.charset.CoderResult::isUnderflow (13 bytes)
     57   6      3  java.lang.StringBuilder::append (8 bytes)
     57   7      3  java.lang.AbstractStringBuilder::append (40 bytes)
     77   9      3  java.lang.Math::min (11 bytes)
     88  10      3  java.util.regex.Pattern::has (15 bytes)
-0.169075164
     90  11      3  NBodySystem::advance (374 bytes)
     92  12      4  NBodySystem::advance (374 bytes)
     97  13      3  nbody::program_main (102 bytes)
     99   1%     3  nbody::program_main @ 49 (102 bytes)
    107  11      3 made not entrant  NBodySystem::advance (374 bytes)
    123   2%     4  nbody::program_main @ 49 (102 bytes)
    128   1%     3 made not entrant  nbody::program_main @ -2 (102 bytes)
-0.169059907
-0.169075164
  22551  14      4  nbody::program_main (102 bytes)
  22565  13      3 made not entrant  nbody::program_main (102 bytes)
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
  89969  15      1  java.lang.Object:: (1 bytes)
  89969   4      3 made not entrant  java.lang.Object:: (1 bytes)
-0.169059907
-0.169075164
 112453  16      3  java.nio.ByteBuffer::arrayOffset (35 bytes)
-0.169059907
-0.169075164
-0.169059907
 157421  17      3  java.nio.CharBuffer::arrayOffset (35 bytes)
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.169075164
 225061  18      -0 java.util.regex.Matcher::gropCount (10 bytes)
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907 292513  19      3  java.lang.String::getChars (66 bytes)
-0.169075164
 292513  20      3  java.lang.CharacterDataLatin1::getProperties (11 bytes)
-0.169059907
      3  java.nio.Buffer::limit (62 bytes)
-0.169075164
 314994  22      3  java.util.Formatter$Flags::contains (22 bytes)
 314994  23      3  java.nio.Buffer:: (68 bytes)
-0.169059907
-0.169075164
 359939  24      3  java.util.regex.Pattern$BmpCharProperty::math (50 bytes)
-0.169075164
 359940  25      3  java.lang.String::substring (83 bytes)
 359940  26      3  java.lang.String:: (20 bytes)
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.169075164
 427367  27      3  java.nio.ByteBuffer::array (35 bytes)
 449885  28      3  java.util.regex.Matcher::reset (83 bytes)
-0.169059907
-0.169075164
 449885  11      3 made zombie  NBodySystem::advance (374 bytes)
 449885   1%     3 made zombie  nbody::program_main @ -2 (102 bytes)
 449886  29      3  java.lang.String::indexOf (151 bytes)
-0.169059907
 472358  30      3  java.util.regex.Pattern$GroupHead::match (47 bytes)
 472358  31      3  java.util.regex.Matcher::group (110 bytes)
 472359  32      3  java.lang.String::indexOf (7 bytes)
-0.169059907
-0.169075164
 494830  33      3  sun.nio.cs.UTF_8$Encoder::encodeArrayLoop (490 bytes)
 494833   4      3 made zombie  java.lang.Object:: (1 bytes)
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
 562648  34      3  java.lang.Character::digit (6 bytes)
 562648  13      3 made zombie  nbody::program_main (102 bytes)
 562648  35      3  java.lang.Character::digit (168 bytes)
 585132  37      3  java.util.regex.Pattern$Branch::match (66 bytes)
-0.169059907
-0.169075164
 585133  36      3  java.io.PrintStream::ensureOpen (18 bytes)
 585133  38      3  java.lang.String::toString (2 bytes)
-0.169059907
-0.169075164
-0.169059907
-0.169075164
 652584  39      3  java.lang.Math::max (11 bytes)
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.169075164
 720036  40      3  java.util.regex.Pattern$Curly::match (86 bytes)
-0.169059907
-0.169075164
 720036  42      3  java.util.regex.Matcher::search (109 bytes)
 720037  41      3  java.util.regex.Pattern$Ctype::isSatisfiedBy (24 bytes)
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.16905990      3  java.lang.String::substring (10 bytes)
-0.169075164
 855408  44      3  java.lang.CharacterDataLatin1::digit (85 bytes)
-0.169059907 
 877880  45      3  java.nio.Buffer::hasRemaining (17 bytes)
-0.169075164
 877880  46      3  java.nio.CharBuffer::hasArray (20 bytes)
 877881  47      3  java.nio.ByteBuffer::hasArray (20 bytes)
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.169075164
 967773  48      3  NBodySystem::energy (189 bytes)
-0.169059907
-0.169075164
 967773  50      3  java.util.regex.Pattern$GroupTail::match (111 bytes)
 967774  49      3  java.util.Formatter::ensureOpen (16 bytes)
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
1080221  51      3  java.io.BufferedWriter::ensureOpen (18 bytes)
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.16907516      3 Body:: (5 bytes)
-0.169059907
-0.169075164
                 3  java.lang.Character::charCount (12 bytes)
-0.169059907
-0.169075164
192639  54      3  java.lang.Character::isHighSurrogate (18 bytes)
-0.169059907
-0.169075164
1215122  55  !   3  java.nio.charset.CharsetEncoder::encode (285 bytes)
1215124  56      3  sun.nio.cs.UTF_8$Encoder::encodeLoop (28 bytes)
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.169075164
-0.169059907
-0.169075164
1327521  57      3  java.util.Locale::getDefault (134 bytes)
-0.169075164
1327522  60      3  java.util.regex.Matcher::getTextLength (10 bytes)
1327522  58      3  java.util.ArrayList::add (29 bytes)
1327523  59      3  java.util.ArrayList::ensureCapacity (58 bytes)
-0.169059907
-0.169075164
-0.169059907
-0.1690751641372468  61      3  sun.misc.FormattedFloatingDecimal::applyPrecision (183 bytes)
-0.169059907
-0.169075164
-0.169059907
---   n   java.lang.Double::doubleToRawLongBits (static)
-0.1690751641417413  62      3  java.nio.Buffer::flip (20 bytes)
1439885  63      3  java.util.regex.Pattern$Single::isSatisfiedBy (14 bytes)
-0.169059907
-0.169075164
1439885  66      3  java.lang.String::subSequence (7 bytes)
1439885  67 s    3  java.io.BufferedOutputStream::flush (12 bytes)
1439886  68      3  java.io.BufferedOutputStream::flushBuffer (29 bytes)
1439886  64      3  java.util.regex.Pattern$Curly::match0 (174 bytes)
1439887  65      3  java.util.regex.Pattern$BranchConn::match (11 bytes)
-0.169059907
-0.169075164
-0.169059907

Revised BSD license

  Home   Conclusions   License   Help