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
 pidigits †1/4 
 spectral-norm †1/2 
 reverse-complement †1/21/10±
 mandelbrot1/2 ±
 fasta± ±
 regex-dna±1/7±
 k-nucleotide±1/4±
 n-body ±
 binary-trees †±±
 fannkuch-redux ±
 Ruby used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/41/41/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
 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% †
 mandelbrot 
Ruby2,167.48544.78179,936925  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%
 regex-dna 
Ruby34.1615.00291,124501  42% 41% 91% 54%
Ruby JRuby58.2821.452,151,328417  65% 63% 63% 82%
 k-nucleotide 
Ruby112.75112.79501,972449  1% 100% 0% 0%
Ruby JRuby92.2383.491,825,996449  5% 55% 47% 5%
 n-body 
Ruby662.33662.517,5041137  0% 1% 0% 100%
Ruby JRuby418.49409.03665,3601137  30% 29% 25% 20%
 binary-trees 
Ruby186.27186.40894,240412  1% 100% 1% 1% †
Ruby JRuby161.45102.931,173,932439  27% 59% 47% 25% †
 fannkuch-redux 
Ruby2,433.052,433.757,508384  0% 0% 0% 100%
Ruby JRuby776.37769.79632,076384  33% 21% 24% 24%
 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