1 : At a glance - Are the Clojure programs faster?

Each chart bar shows, for one unidentified benchmark, how much the fastest Clojure program used compared to the fastest Java program.

(Memory use is only compared for tasks that require memory to be allocated.)


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.

 2 : Approximately - Are the Clojure programs faster?

Each table row shows, for one named benchmark, how much the fastest Clojure program used compared to the fastest Java program.

(Memory use is only compared for tasks that require memory to be allocated.)

 Clojure used what fraction? used how many times more? 
Benchmark Time Memory Code
 k-nucleotide±1/3
 regex-dna±±±
 fannkuch-redux± ±
 n-body± 
 spectral-norm± ±
 pidigits †± 
 mandelbrot± 
 fasta-redux † ±
 reverse-complement1/2
 binary-trees±
 fasta † ±
 Clojure used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±±±

† possible mismatch - one-core program compared to multi-core program.

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

 3 : Measurements - Are the Clojure programs faster?

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 Clojure program are shown for comparison against measurements of the fastest Java program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 k-nucleotide 
Clojure22.518.81360,4602852  82% 69% 38% 69%
Java38.6611.291,118,2881844  83% 97% 82% 82%
 regex-dna 
Clojure29.348.84607,884707  94% 81% 80% 78%
Java24.708.24761,724929  68% 73% 77% 83%
 fannkuch-redux 
Clojure76.7420.0574,4761491  96% 99% 94% 94%
Java68.6417.4133,0321282  98% 98% 99% 99%
 n-body 
Clojure27.6426.4266,8562324  3% 84% 17% 2%
Java22.6822.6630,0361424  97% 3% 0% 1%
 spectral-norm 
Clojure18.565.3772,172918  93% 86% 86% 82%
Java16.534.2832,696950  96% 96% 96% 99%
 pidigits 
Clojure5.804.2792,7001944  8% 11% 19% 100% †
Java3.223.1233,528938  3% 2% 80% 21% †
 mandelbrot 
Clojure32.409.02152,9761195  89% 86% 97% 88%
Java24.246.2788,992796  96% 97% 97% 98%
 fasta-redux 
Clojure6.515.1179,5921605  82% 26% 9% 12% †
Java2.652.5929,9401443  1% 76% 1% 25% †
 reverse-complement 
Clojure4.362.77585,660727  10% 17% 43% 91%
Java2.681.27315,2961661  41% 48% 34% 92%
 binary-trees 
Clojure45.9513.92628,936750  91% 86% 81% 75%
Java8.005.67356,656583  39% 39% 36% 32%
 fasta 
Clojure7.846.6476,2921692  89% 8% 16% 7% †
Java5.602.1939,3682457  58% 72% 66% 61% †

† possible mismatch - one-core program compared to multi-core program.

 4 : Are there other Clojure programs for these benchmarks?

Remember - those are just the fastest Clojure and Java programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Clojure.

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

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Clojure and Java 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.

 Clojure :  

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

Clojure 1.7

Clojure benchmarks

Home Page: http://clojure.org/

Download: http://clojure.org/downloads

Revised BSD license

  Home   Conclusions   License   Play