The Computer Language
Benchmarks Game

Ruby programs versus Python 3

by benchmark task performance

binary-trees
source secs KB gz cpu cpu load
Ruby 165.40 240,392 402 165.21 0% 1% 1% 100%
Python 3 475.84 850,920 596 475.38 0% 1% 0% 100%
spectral-norm
source secs KB gz cpu cpu load
Ruby 318.90 9,108 326 318.82 1% 0% 1% 100%
Python 3 857.31 9,224 328 857.02 1% 1% 0% 100%
k-nucleotide
source secs KB gz cpu cpu load
Ruby 108.62 501,712 449 108.59 0% 1% 1% 100%
Python 3 284.38 153,732 1937 284.04 0% 1% 1% 100%
n-body
source secs KB gz cpu cpu load
Ruby 690.08 7,072 1137 689.90 1% 0% 0% 100%
Python 3 938.72 8,112 1228 938.49 0% 1% 1% 100%
fasta
source secs KB gz cpu cpu load
Ruby 96.91 59,620 973 96.87 1% 0% 1% 100%
Python 3 110.68 8,148 977 110.64 1% 1% 1% 100%
regex-dna
source secs KB gz cpu cpu load
Ruby 24.33 145,900 442 24.32 0% 1% 0% 100%
Python 3 24.05 317,412 424 24.04 1% 0% 1% 100%
fannkuch-redux
source secs KB gz cpu cpu load
Ruby 2,350.70 7,048 384 2,350.01 1% 0% 0% 100%
Python 3 2,132.93 56,676 944 2,132.33 1% 1% 1% 100%
mandelbrot
source secs KB gz cpu cpu load
Ruby 1,911.01 62,736 1019 1,910.36 0% 1% 1% 100%
Python 3 1,072.06 55,872 686 1,071.62 0% 1% 1% 100%
reverse-complement
source secs KB gz cpu cpu load
Ruby 8.38 131,592 255 8.37 1% 0% 0% 100%
Python 3 4.47 264,580 800 4.45 0% 1% 1% 100%
pidigits
source secs KB gz cpu cpu load
Ruby 8.39 276,892 653 8.37 1% 3% 0% 100%
Python 3 2.20 10,300 335 2.20 1% 0% 1% 100%
fasta-redux
source secs KB gz cpu cpu load
Ruby 1.20 7,900 772 1.19 1% 2% 2% 100%
  No program contribute your program
Ruby

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

Python 3

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