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
 regex-dna±±±
 pidigits †± 
 n-body± 
 mandelbrot± 
 k-nucleotide±1/3
 binary-trees±±
 fannkuch-redux ±
 spectral-norm ±
 reverse-complement1/2
 fasta-redux † ±
 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
 regex-dna 
Clojure28.218.82642,768707  77% 98% 73% 73%
Java25.798.80729,244929  77% 80% 72% 66%
 pidigits 
Clojure6.875.3075,1921944  18% 39% 58% 17% †
Java4.174.0726,324938  3% 3% 4% 96% †
 n-body 
Clojure34.6033.2654,2762324  98% 2% 2% 3%
Java24.3424.3124,1561424  1% 1% 1% 100%
 mandelbrot 
Clojure35.219.79155,7041195  95% 88% 89% 89%
Java27.797.1287,832796  97% 99% 97% 97%
 k-nucleotide 
Clojure40.4815.35393,5282852  59% 65% 71% 70%
Java35.2710.611,199,1841844  79% 78% 90% 88%
 binary-trees 
Clojure33.9210.45534,788750  84% 90% 78% 73%
Java19.645.88513,180926  95% 79% 87% 76%
 fannkuch-redux 
Clojure135.7735.2255,0081491  98% 99% 98% 99%
Java67.5617.1325,8041282  100% 98% 99% 98%
 spectral-norm 
Clojure41.6411.3553,388808  93% 93% 91% 90%
Java16.534.3026,476950  99% 96% 95% 96%
 reverse-complement 
Clojure6.584.54517,384727  29% 12% 58% 49%
Java2.911.44308,0601661  47% 31% 85% 43%
 fasta-redux 
Clojure9.708.1060,9241605  7% 64% 36% 15% †
Java1.991.9324,5881443  98% 2% 4% 3% †
 fasta 
Clojure11.159.7261,1281692  7% 98% 5% 7% †
Java5.901.8231,6002457  80% 83% 80% 82% †

† 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) Server VM (build 25.45-b02, mixed mode)

Clojure 1.7.0

Clojure benchmarks

Home Page: http://clojure.org/

Download: http://clojure.org/downloads

Revised BSD license

  Home   Conclusions   License   Play