The Computer Language
Benchmarks Game

Ruby programs versus Python 3

by benchmark task performance

binary-trees
source secs KB gz cpu cpu load
Ruby 67.48 114,588 1123 193.75 63% 63% 66% 96%
Python 3 136.58 478,168 596 510.34 93% 96% 96% 93%
spectral-norm
source secs KB gz cpu cpu load
Ruby 168.14 25,624 828 648.25 96% 97% 97% 97%
Python 3 282.36 47,144 437 1,119.57 99% 99% 99% 99%
regex-dna
source secs KB gz cpu cpu load
Ruby 12.28 348,464 501 36.13 65% 78% 70% 82%
Python 3 11.15 252,032 478 24.90 48% 40% 47% 89%
n-body
source secs KB gz cpu cpu load
Ruby 1,491.95 5,084 1137 1,491.56 22% 0% 79% 1%
Python 3 1,005.92 6,444 1228 1,005.65 100% 1% 0% 1%
fannkuch-redux
source secs KB gz cpu cpu load
Ruby 1,129.01 18,528 1426 4,399.70 98% 96% 100% 97%
Python 3 638.70 44,820 944 2,512.66 96% 99% 99% 100%
k-nucleotide
source secs KB gz cpu cpu load
Ruby 187.14 501,072 449 184.06 6% 93% 0% 1%
Python 3 83.25 163,092 1937 320.96 98% 96% 96% 97%
reverse-complement
source secs KB gz cpu cpu load
Ruby 10.46 129,336 255 10.45 0% 0% 1% 100%
Python 3 3.92 262,588 800 5.69 24% 6% 45% 73%
pidigits
source secs KB gz cpu cpu load
Ruby 8.66 221,708 653 8.64 1% 100% 0% 0%
Python 3 2.74 8,432 335 2.74 100% 1% 1% 1%
fasta
source secs KB gz cpu cpu load
Ruby 186.77 56,588 973 186.43 12% 46% 35% 10%
Python 3 56.91 2,483,536 1933 149.79 62% 77% 52% 78%
mandelbrot
source secs KB gz cpu cpu load
Ruby 1,052.60 51,408 1019 4,203.22 100% 100% 100% 100%
Python 3 306.32 41,240 686 1,222.44 100% 100% 100% 100%
fasta-redux
source secs KB gz cpu cpu load
Ruby 1.97 5,704 772 1.96 97% 1% 1% 3%
  No program contribute your program
Ruby

ruby 2.2.1p85 (2015-02-26 revision 49769) [i686-linux]

Python 3

Python 3.5.0 (default, Sep 14 2015, 09:36:50) [GCC 4.9.2] on linux