/mobile Handheld Friendly website

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
 spectral-norm1/2 
 fasta± ±
 k-nucleotide †±±±
 n-body± ±
 binary-trees †1/2±
 reverse-complement1/6±
 regex-dna±±
 mandelbrot ±
 fannkuch-redux † 1/2
 pidigits ±
 Ruby used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/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 Python 3 program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 spectral-norm 
Ruby643.78166.2926,908828  97% 97% 97% 97%
Python 31,026.66258.4230,260437  99% 99% 99% 99%
 fasta 
Ruby217.79221.465,284987  36% 18% 33% 15%
Python 3241.56246.324,324788  30% 24% 15% 33%
 k-nucleotide 
Ruby201.00201.08499,252449  0% 0% 0% 100% †
Python 3488.50161.33364,488647  89% 60% 98% 56% †
 n-body 
Ruby1,409.571,410.005,2801137  0% 1% 100% 0%
Python 3984.27984.534,2521181  0% 100% 0% 0%
 binary-trees 
Ruby220.52220.62343,968439  0% 1% 1% 100% †
Python 3526.56139.26688,512626  93% 96% 96% 94% †
 reverse-complement 
Ruby10.6110.62127,848255  0% 0% 100% 1%
Python 36.536.55781,144325  0% 1% 0% 100%
 regex-dna 
Ruby42.9019.90271,304501  37% 41% 100% 38%
Python 323.8111.01248,260478  37% 72% 45% 64%
 mandelbrot 
Ruby4,392.271,099.9588,412925  100% 100% 100% 100%
Python 31,837.41483.667,488777  100% 94% 93% 94%
 fannkuch-redux 
Ruby3,079.023,079.935,288384  0% 0% 0% 100% †
Python 34,000.061,012.0627,840797  99% 99% 98% 100% †
 pidigits 
Ruby11.0611.0872,388240  1% 1% 0% 100%
Python 33.053.065,332256  1% 1% 0% 100%
 fasta-redux 
Ruby1.852.206,568772  0% 1% 92% 5%
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 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) [i686-linux]

Home Page: Ruby is…

Download: Ruby 2.1.0 is released

Revised BSD license

  Home   Conclusions   License   Play