The Computer Language
Benchmarks Game

Ruby programs versus Python 3

by benchmark task performance

binary-trees
source secs KB gz cpu cpu load
Ruby 179.60 117,640 402 179.49 1% 1% 100% 100%
Python 3 497.80 482,656 596 497.40 1% 1% 1% 100%
spectral-norm
source secs KB gz cpu cpu load
Ruby 520.06 7,584 326 519.86 0% 1% 100% 100%
Python 3 1,105.41 7,120 328 1,105.02 1% 0% 0% 100%
k-nucleotide
source secs KB gz cpu cpu load
Ruby 186.17 502,900 449 182.95 1% 1% 100% 100%
Python 3 317.42 219,028 1937 317.16 0% 1% 1% 100%
regex-dna
source secs KB gz cpu cpu load
Ruby 26.32 154,492 442 26.30 1% 0% 100% 100%
Python 3 25.11 249,088 478 24.98 1% 0% 1% 100%
fannkuch-redux
source secs KB gz cpu cpu load
Ruby 2,604.22 7,112 384 2,603.32 1% 17% 72% 100%
Python 3 2,464.08 44,564 944 2,463.20 1% 0% 0% 100%
n-body
source secs KB gz cpu cpu load
Ruby 1,429.79 7,284 1137 1,429.24 1% 18% 83% 100%
Python 3 1,024.87 6,324 1228 1,024.54 1% 0% 1% 100%
fasta
source secs KB gz cpu cpu load
Ruby 197.80 197,072 904 197.62 1% 1% 100% 100%
Python 3 122.25 6,508 977 122.19 1% 1% 1% 100%
reverse-complement
source secs KB gz cpu cpu load
Ruby 9.15 623,560 536 9.12 1% 1% 1% 100%
Python 3 5.54 262,360 800 5.53 1% 1% 1% 100%
mandelbrot
source secs KB gz cpu cpu load
Ruby 222.26 7,012 307 222.17 1% 0% 0% 100%
Python 3 75.62 41,108 686 75.54 1% 0% 0% 100%
pidigits
source secs KB gz cpu cpu load
Ruby 10.71 152,052 240 10.69 1% 100% 1% 100%
Python 3 2.74 8,468 335 2.73 0% 1% 1% 100%
fasta-redux
source secs KB gz cpu cpu load
Ruby 1.73 7,784 750 1.72 1% 5% 100% 100%
  No program contribute your program
Ruby

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

Python 3

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