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

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 : Approximately - Are the Ruby programs faster?

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
 reverse-complement1/21/5±
 pidigits1/2 ±
 regex-dna1/21/5±
 binary-trees±1/14±
 spectral-norm± ±
 fasta± ±
 k-nucleotide1/3±
 n-body ±
 mandelbrot ±
 fannkuch-redux ±
 Ruby used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/21/21/2±

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

 3 : Measurements - Are the Ruby 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 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
 reverse-complement 
Ruby10.3810.40129,084255  0% 1% 0% 100%
Ruby JRuby23.2123.24587,052255  0% 1% 1% 100%
 pidigits 
Ruby11.1811.20148,712240  0% 0% 1% 100%
Ruby JRuby22.4322.47279,480242  0% 1% 1% 100%
 regex-dna 
Ruby28.6228.63152,388442  0% 1% 1% 100%
Ruby JRuby48.7248.75798,716343  0% 1% 0% 100%
 binary-trees 
Ruby181.10181.20114,296402  1% 0% 1% 100%
Ruby JRuby187.95188.201,641,316402  0% 1% 1% 100%
 spectral-norm 
Ruby585.28585.445,800326  0% 1% 1% 100%
Ruby JRuby500.57501.30288,056326  0% 1% 1% 100%
 fasta 
Ruby184.94185.0256,664973  1% 1% 1% 100%
Ruby JRuby155.47156.27326,424973  0% 1% 1% 100%
 k-nucleotide 
Ruby182.68182.73501,036449  0% 0% 1% 100%
Ruby JRuby112.13112.231,631,204449  0% 1% 1% 100%
 n-body 
Ruby1,467.711,468.115,1241137  0% 1% 1% 100%
Ruby JRuby761.20762.20276,5561137  0% 1% 1% 100%
 mandelbrot 
Ruby251.94252.015,080307  0% 1% 1% 100%
Ruby JRuby130.03130.20276,996307  0% 1% 1% 100%
 fannkuch-redux 
Ruby2,722.152,722.875,036384  0% 0% 1% 100%
Ruby JRuby1,121.591,121.95274,216384  0% 1% 1% 100%
 fasta-redux 
Ruby1.941.965,704772  1% 4% 1% 99%
No 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.2.1p85 (2015-02-26 revision 49769) [i686-linux]

Home Page: Ruby is…

Download: Ruby 2.2.1 Released

Revised BSD license

  Home   Conclusions   License   Play