The Computer Language
Benchmarks Game

Ruby programs versus Python 3

by benchmark task performance

binary-trees
source secs KB gz cpu cpu load
Ruby 57.98 243,912 1123 168.33 96% 65% 68% 64%
Python 3 152.06 804,624 596 516.24 94% 92% 95% 91%
spectral-norm
source secs KB gz cpu cpu load
Ruby 134.21 54,680 835 516.92 97% 97% 96% 96%
Python 3 250.12 58,892 437 932.41 94% 95% 92% 93%
n-body
source secs KB gz cpu cpu load
Ruby 694.21 9,144 1137 694.04 0% 1% 100% 0%
Python 3 923.74 8,040 1181 923.49 44% 13% 0% 44%
regex-dna
source secs KB gz cpu cpu load
Ruby 9.35 108,284 529 27.11 71% 63% 91% 67%
Python 3 10.58 266,312 478 23.44 49% 39% 68% 68%
fasta
source secs KB gz cpu cpu load
Ruby 113.64 59,200 973 113.60 1% 100% 0% 1%
Python 3 111.44 8,276 977 111.40 28% 0% 0% 73%
fannkuch-redux
source secs KB gz cpu cpu load
Ruby 788.85 37,668 1426 3,065.01 100% 99% 99% 91%
Python 3 567.35 55,368 944 2,220.71 98% 96% 100% 99%
k-nucleotide
source secs KB gz cpu cpu load
Ruby 109.09 505,688 449 109.06 1% 0% 100% 0%
Python 3 76.50 162,004 1937 297.12 97% 97% 97% 99%
mandelbrot
source secs KB gz cpu cpu load
Ruby 438.01 72,684 1019 1,748.64 100% 100% 100% 100%
Python 3 293.92 55,392 686 1,171.64 100% 100% 100% 100%
reverse-complement
source secs KB gz cpu cpu load
Ruby 5.24 686,764 536 9.66 77% 30% 28% 52%
Python 3 3.11 266,972 800 4.56 20% 99% 2% 29%
pidigits
source secs KB gz cpu cpu load
Ruby 11.18 163,168 242 11.16 96% 0% 1% 6%
Python 3 2.20 10,248 335 2.20 1% 0% 0% 100%
fasta-redux
source secs KB gz cpu cpu load
Ruby 1.24 10,040 750 1.24 1% 100% 3% 2%
  No program contribute your program
Ruby

ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

Python 3

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