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 Ruby JRuby 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 Ruby JRuby 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
 mandelbrot1/94 ±
 spectral-norm †1/45 
 fasta1/31 
 fannkuch-redux1/18 ±
 n-body1/14 
 k-nucleotide †1/91/5
 binary-trees1/71/2
 reverse-complement1/71/2
 pidigits1/3 
 regex-dna1/2±±
 Clojure used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/941/941/311/111/71/31/2

† 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 Ruby JRuby program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 mandelbrot 
Clojure32.409.02152,9761195  89% 86% 97% 88%
Ruby JRuby3,308.31847.98762,944866  98% 98% 98% 98%
 spectral-norm 
Clojure18.565.3772,172918  93% 86% 86% 82% †
Ruby JRuby250.63243.93673,640326  21% 24% 31% 28% †
 fasta 
Clojure7.846.6476,2921692  89% 8% 16% 7%
Ruby JRuby214.27207.73664,912760  27% 35% 20% 22%
 fannkuch-redux 
Clojure76.7420.0574,4761491  96% 99% 94% 94%
Ruby JRuby1,296.44357.64684,4681426  90% 92% 99% 82%
 n-body 
Clojure27.6426.4266,8562324  3% 84% 17% 2%
Ruby JRuby382.88375.10755,9801137  23% 23% 28% 29%
 k-nucleotide 
Clojure22.518.81360,4602852  82% 69% 38% 69% †
Ruby JRuby85.3580.181,870,964449  8% 37% 20% 45% †
 binary-trees 
Clojure45.9513.92628,936750  91% 86% 81% 75%
Ruby JRuby157.7997.791,168,552402  52% 25% 25% 68%
 reverse-complement 
Clojure4.362.77585,660727  10% 17% 43% 91%
Ruby JRuby24.8418.241,284,372255  22% 14% 14% 88%
 pidigits 
Clojure5.804.2792,7001944  8% 11% 19% 100%
Ruby JRuby18.5412.70666,456242  18% 46% 66% 17%
 regex-dna 
Clojure29.348.84607,884707  94% 81% 80% 78%
Ruby JRuby49.5816.58787,976507  69% 67% 81% 84%
 fasta-redux 
Clojure2.581.4061,0961605  89% 42% 36% 21%
No program

† 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 Ruby JRuby 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 Ruby JRuby 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