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 Python 3 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 Python 3 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-nucleotide1/9±
 binary-trees1/21/51/2
 spectral-norm1/2 ±
 fasta± ±
 regex-dna±1/2±
 fannkuch-redux± ±
 n-body± ±
 reverse-complement1/6±
 mandelbrot 1/3
 pidigits ±
 Ruby used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/91/91/2±

± 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 Python 3 program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 k-nucleotide 
Ruby51.9752.02357,432996  0% 1% 1% 100%
Python 3490.63492.77431,792647  0% 1% 1% 100%
 binary-trees 
Ruby212.24212.32135,148402  0% 1% 1% 100%
Python 3506.90507.35688,448626  1% 1% 1% 100%
 spectral-norm 
Ruby607.99608.156,016326  0% 1% 1% 100%
Python 3939.78940.065,004328  0% 1% 0% 100%
 fasta 
Ruby234.24234.705,380987  1% 1% 1% 100%
Python 3234.62237.784,316792  1% 1% 1% 100%
 regex-dna 
Ruby29.8329.84143,640442  0% 1% 1% 100%
Python 323.9223.94247,788424  0% 1% 1% 100%
 fannkuch-redux 
Ruby3,316.173,317.055,348384  0% 1% 1% 100%
Python 32,649.782,655.584,192385  0% 0% 0% 100%
 n-body 
Ruby143.56143.605,4561137  0% 1% 0% 100%
Python 397.8697.894,2561181  0% 0% 0% 100%
 reverse-complement 
Ruby11.0411.05129,852255  0% 1% 1% 100%
Python 36.546.56781,140325  1% 0% 1% 100%
 mandelbrot 
Ruby242.02242.095,368307  1% 0% 0% 100%
Python 3110.09110.26103,888777  1% 1% 1% 100%
 pidigits 
Ruby11.2711.2973,448240  0% 1% 1% 100%
Python 33.043.055,312256  1% 0% 0% 100%
 fasta-redux 
Ruby1.931.946,608772  2% 0% 1% 100%
No program

 4 : Are there other Ruby programs for these benchmarks?

Remember - those are just the fastest Ruby and Python 3 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 Python 3 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.5p273 (2014-11-13 revision 48405) [i686-linux]

Home Page: Ruby is…

Download: Ruby 2.1.0 is released

Revised BSD license

  Home   Conclusions   License   Play