vs

 1 : Are the Ruby programs faster? At a glance.

Each chart bar shows, for one unidentified benchmark, how much the fastest Ruby 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 : Are the Ruby programs faster? Approximately.

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

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

 Ruby used what fraction? used how many times more? 
Benchmark Time Memory Code
 k-nucleotide †1/71/4
 pidigits †1/4 
 spectral-norm †1/2 
 reverse-complement †1/21/10±
 binary-trees1/21/5
 regex-dna1/21/7±
 mandelbrot1/2 ±
 fasta± ±
 n-body ±
 fannkuch-redux ±
 Ruby used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/71/71/21/2±±

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

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

 3 : Are the Ruby programs faster? Measurements.

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 Ruby 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
 k-nucleotide 
Ruby37.8612.66423,736996  69% 65% 69% 96% †
Ruby JRuby92.2383.491,825,996449  5% 55% 47% 5% †
 pidigits 
Ruby3.283.29639,156478  1% 3% 1% 100% †
Ruby JRuby17.5912.66650,764240  77% 29% 18% 16% †
 spectral-norm 
Ruby379.9798.7042,696828  96% 96% 97% 97% †
Ruby JRuby251.58245.32660,988326  29% 35% 17% 24% †
 reverse-complement 
Ruby8.358.36130,032255  0% 100% 1% 0% †
Ruby JRuby26.4619.661,243,664255  12% 49% 61% 15% †
 binary-trees 
Ruby169.9456.82257,5921123  68% 71% 96% 65%
Ruby JRuby161.45102.931,173,932439  27% 59% 47% 25%
 regex-dna 
Ruby28.7710.12118,504529  91% 60% 66% 68%
Ruby JRuby51.5317.56787,708507  76% 75% 66% 77%
 mandelbrot 
Ruby2,010.04503.3370,3481019  100% 100% 100% 100%
Ruby JRuby3,371.07864.012,262,712866  98% 98% 98% 98%
 fasta 
Ruby146.20151.337,520987  27% 30% 7% 39%
Ruby JRuby222.09218.60625,440760  22% 22% 38% 24%
 n-body 
Ruby662.33662.517,5041137  0% 1% 0% 100%
Ruby JRuby418.49409.03665,3601137  30% 29% 25% 20%
 fannkuch-redux 
Ruby3,151.92810.0531,5121426  98% 97% 97% 98%
Ruby JRuby1,816.07489.43650,4721426  98% 91% 94% 90%
 fasta-redux 
Ruby1.181.638,132772  1% 90% 7% 2%
No program

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

 4 : Are there other Ruby programs for these benchmarks?

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

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

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Ruby 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.

 Ruby : the new Ruby 

online book Programming Ruby: The Pragmatic Programmers Guide

ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]

Home Page: Ruby is…

Download: Ruby 2.1.0 is released

Revised BSD license

  Home   Conclusions   License   Play