The Computer Language
Benchmarks Game

Ruby programs versus Python 3

by benchmark task performance

binary-trees
source secs mem gz cpu cpu load
Ruby 47.66 511,724 1083 137.38 66% 90% 70% 63%
Python 3 93.55 280,624 589 337.74 92% 89% 87% 93%
spectral-norm
source secs mem gz cpu cpu load
Ruby 119.33 49,312 835 461.61 97% 97% 97% 97%
Python 3 180.97 15,876 443 720.51 100% 100% 100% 100%
n-body
source secs mem gz cpu cpu load
Ruby 641.41 8,848 1137 641.26 8% 93% 0% 0%
Python 3 838.39 10,324 1196 838.20 95% 1% 5% 0%
pidigits
source secs mem gz cpu cpu load
Ruby 2.97 306,652 485 2.96 1% 0% 3% 100%
Python 3 3.43 12,716 386 3.43 100% 1% 1% 0%
reverse-complement
source secs mem gz cpu cpu load
Ruby 3.73 571,404 517 7.00 49% 34% 96% 10%
Python 3 3.26 264,596 814 4.67 18% 99% 1% 26%
fannkuch-redux
source secs mem gz cpu cpu load
Ruby 671.17 30,416 1432 2,613.66 98% 100% 100% 92%
Python 3 565.97 15,528 950 2,172.63 95% 94% 95% 100%
k-nucleotide
source secs mem gz cpu cpu load
Ruby 95.27 381,212 858 342.07 97% 86% 86% 91%
Python 3 77.65 182,700 1967 302.86 97% 99% 97% 98%
fasta
source secs mem gz cpu cpu load
Ruby 99.67 106,544 1002 99.65 0% 0% 100% 0%
Python 3 59.47 15,996 1947 138.97 55% 55% 63% 66%
regex-redux
source secs mem gz cpu cpu load
Ruby 25.64 311,964 431 25.63 6% 4% 60% 31%
Python 3 15.22 447,324 512 27.44 25% 33% 32% 91%
mandelbrot
source secs mem gz cpu cpu load
Ruby 520.83 127,152 925 2,081.07 100% 100% 100% 100%
Python 3 225.24 15,736 688 899.25 100% 100% 100% 100%
Ruby

ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]

Python 3

Python 3.6.3