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/3±±
 binary-trees1/3±1/2
 spectral-norm1/2 ±
 n-body± ±
 fasta± ±
 fannkuch-redux± ±
 regex-dna±1/2±
 mandelbrot± 1/3
 pidigits± 
 reverse-complement±1/8±
 Ruby used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/31/31/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 
Ruby112.27112.31501,972449  0% 0% 0% 100%
Python 3372.03374.89456,532647  0% 1% 1% 100%
 binary-trees 
Ruby184.49184.65825,196412  1% 1% 0% 100%
Python 3479.82480.361,123,040626  0% 1% 1% 100%
 spectral-norm 
Ruby344.69344.789,504326  0% 1% 0% 100%
Python 3746.94747.206,468328  1% 0% 0% 100%
 n-body 
Ruby659.78659.957,5201137  0% 0% 0% 100%
Python 3932.49932.795,5721181  1% 0% 0% 100%
 fasta 
Ruby144.98149.947,512987  1% 1% 0% 100%
Python 3156.10160.135,572792  1% 0% 0% 100%
 fannkuch-redux 
Ruby2,360.962,361.657,512384  0% 0% 0% 100%
Python 32,333.002,333.785,416385  1% 0% 0% 100%
 regex-dna 
Ruby25.2025.21164,804442  1% 1% 0% 100%
Python 323.0823.19257,976478  0% 1% 1% 100%
 mandelbrot 
Ruby1,864.391,864.927,508307  1% 1% 0% 100%
Python 31,671.631,672.33110,552777  0% 1% 1% 100%
 pidigits 
Ruby3.283.29639,684478  0% 1% 1% 100%
Python 32.392.396,612256  2% 0% 1% 100%
 reverse-complement 
Ruby8.358.36130,036255  0% 1% 0% 100%
Python 35.986.001,008,592325  0% 1% 1% 100%
 fasta-redux 
Ruby1.161.168,132772  0% 0% 0% 99%
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.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