/mobile Handheld Friendly website
Ubuntu : Intel® Q6600® quad-core |
Each chart bar shows, for one unidentified benchmark, how much the fastest Java 7 program used compared to the fastest Lisp SBCL program.
These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples.
Each table row shows, for one named benchmark, how much the fastest Java 7 program used compared to the fastest Lisp SBCL program.
| Java 7 used what fraction? used how many times more? | ||||
|---|---|---|---|---|
| Benchmark | Time | Memory | Code | |
| k-nucleotide † | 1/5 | 5× | ± | |
| fasta-redux | 1/5 | 2× | ± | |
| reverse-complement † | 1/3 | 2× | 2× | |
| mandelbrot | 1/2 | 2× | 1/3 | |
| regex-dna | 1/2 | ± | 1/2 | |
| binary-trees † | 1/2 | 2× | 2× | |
| fasta | 1/2 | 2× | ± | |
| n-body | 1/2 | 3× | ± | |
| spectral-norm | ± | 3× | ± | |
| fannkuch-redux | ± | ± | ± | |
| pidigits † | 2× | 10× | 2× | |
| Java 7 used what fraction? used how many times more? | |||||||
|---|---|---|---|---|---|---|---|
| Time-used | |- | |--- | 25% | median | 75% | ---| | -| |
| (Elapsed secs) | 1/5 | 1/5 | 1/3 | 1/2 | ± | 2× | 2× |
† possible mismatch - one-core program compared to multi-core program.
± read the measurements and then read the program source code.
These are not the only tasks that could be solved. These are just 10 tiny examples. These are not the only compilers and interpreters. These are not the only programs that could be written.
For each named benchmark, measurements of the fastest Java 7 program are shown for comparison against measurements of the fastest Lisp SBCL program.
| Program Source Code | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| k-nucleotide | |||||
| Java 7 | 44.83 | 12.93 | 494,264 | 1602 | 84% 81% 85% 99% † |
| Lisp SBCL | 69.14 | 69.22 | 105,244 | 2272 | 0% 0% 0% 100% † |
| fasta-redux | |||||
| Java 7 | 1.90 | 1.85 | 14,500 | 1443 | 1% 2% 3% 100% |
| Lisp SBCL | 9.24 | 9.25 | 9,356 | 2005 | 0% 1% 0% 100% |
| reverse-complement | |||||
| Java 7 | 2.93 | 1.52 | 294,784 | 1661 | 32% 59% 58% 47% † |
| Lisp SBCL | 4.78 | 4.79 | 164,812 | 896 | 0% 98% 2% 0% † |
| mandelbrot | |||||
| Java 7 | 27.14 | 6.90 | 67,612 | 796 | 98% 98% 99% 99% |
| Lisp SBCL | 67.13 | 16.95 | 35,300 | 2459 | 99% 99% 99% 99% |
| regex-dna | |||||
| Java 7 | 27.09 | 9.43 | 708,060 | 929 | 65% 83% 78% 63% |
| Lisp SBCL | 46.12 | 22.59 | 946,444 | 1948 | 35% 42% 43% 86% |
| binary-trees | |||||
| Java 7 | 21.35 | 9.21 | 525,420 | 1007 | 50% 70% 48% 65% † |
| Lisp SBCL | 20.41 | 20.45 | 220,104 | 649 | 83% 0% 18% 0% † |
| fasta | |||||
| Java 7 | 5.07 | 4.99 | 14,976 | 1507 | 2% 0% 100% 1% |
| Lisp SBCL | 8.17 | 8.18 | 8,272 | 1751 | 0% 0% 0% 100% |
| n-body | |||||
| Java 7 | 24.41 | 24.39 | 13,976 | 1424 | 0% 0% 0% 100% |
| Lisp SBCL | 37.55 | 37.56 | 4,088 | 1398 | 0% 0% 0% 100% |
| spectral-norm | |||||
| Java 7 | 16.39 | 4.21 | 14,740 | 950 | 97% 97% 98% 99% |
| Lisp SBCL | 15.75 | 4.02 | 4,488 | 906 | 98% 98% 99% 98% |
| fannkuch-redux | |||||
| Java 7 | 67.91 | 17.17 | 14,460 | 1282 | 98% 99% 100% 100% |
| Lisp SBCL | 57.30 | 14.77 | 14,112 | 1518 | 98% 99% 97% 94% |
| pidigits | |||||
| Java 7 | 11.75 | 5.12 | 46,488 | 1826 | 70% 67% 56% 39% † |
| Lisp SBCL | 2.76 | 2.77 | 4,884 | 1073 | 1% 0% 0% 100% † |
† possible mismatch - one-core program compared to multi-core program.
Remember - those are just the fastest Java 7 and Lisp SBCL programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Java 7.
Maybe one of those other Java 7 programs is fastest on a different OS/machine.
Remember - those are just the fastest Java 7 and Lisp SBCL 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 version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) Server VM (build 23.6-b04, mixed mode)
Home Page: Java SE at a Glance
Download: Java SE Downloads
Let's see how much, or how little, the time taken to invoke the JVM might contribute to the usual Java program times shown in the benchmarks game. Here are some additional (Intel® Q6600® quad-core) elapsed time measurements, taken after the Java programs started and before they exited.
In the first case (Cold), we simply started and measured the program 66 times; and then discarded the first measurement leaving 65 data points.
public static void main(String[] args){
for (int i=0; i<1; ++i){
System.gc();
long t1 = System.nanoTime();
nbody.program_main(args);
long t2 = System.nanoTime();
System.err.println( String.format( "%.6f", (t2 - t1) * 1e-9 ) );
}
}
In the second case (Warmed), we started the program once and repeated measurements again and again and again 66 times without restarting the JVM; and then discarded the first measurement leaving 65 data points.
public static void main(String[] args){
for (int i=0; i<66; ++i){
System.gc();
long t1 = System.nanoTime();
nbody.program_main(args);
long t2 = System.nanoTime();
System.err.println( String.format( "%.6f", (t2 - t1) * 1e-9 ) );
}
}
Compare these additional measurements against the usual Java program measurements shown in the benchmarks game --
| "1.7.0_06" Java HotSpot(TM) 64-Bit Server VM | ||||||
|---|---|---|---|---|---|---|
| System.nanoTime() | 1) Cold | 2) Warmed | ||||
| mean | σ | mean | σ | usual | ||
| meteor contest | 0.0118s | 0.0007 | 0.0016s | 0.0002 | 0.22s | |
| fasta-redux | 2.45s | 0.00 | 2.32s | 0.00 | 2.51s | |
| spectral-norm | 4.44s | 0.02 | 4.20s | 0.16 | 4.51s | |
| pidigits | 4.69s | 0.09 | 4.44s | 0.05 | 4.61s | |
| fasta | 5.07s | 0.46 | 4.84s | 0.02 | 5.13s | |
| chameneos-redux | 5.84s | 0.46 | 5.70s | 0.48 | 5.65s | |
| mandelbrot | 7.93s | 0.23 | 7.99s | 0.01 | 7.02s | |
| k-nucleotide | 8.09s | 0.28 | -- | -- | 8.05s | |
| regex-dna | 8.65s | 0.27 | -- | -- | 8.61s | |
| binary-trees | 10.54s | 0.28 | 7.66s | 0.16 | 9.08s | |
| fannkuch-redux | 16.89s | 1.32 | 17.26s | 0.10 | 17.38s | |
| nbody | 22.43s | 0.00 | 22.41s | 0.00 | 22.50s | |
| binary-trees-redux | 34.15s | 0.39 | 33.93s | 0.31 | 33.38s | |
The largest and most obvious effects of bytecode loading and dynamic optimization can be seen with the meteor-contest program which only runs for a fraction of a second.