The Computer Language
Benchmarks Game

Ruby versus Python 3 fastest programs

by faster benchmark performance

n-body
source secs mem gz cpu cpu load
Ruby 357.61 12,284 1137 401.68 8% 95% 5% 5%
Python 3 882.00 8,212 1196 881.81 91% 0% 1% 9%
binary-trees
source secs mem gz cpu cpu load
Ruby 52.41 434,004 1107 176.92 88% 85% 77% 89%
Python 3 92.72 448,844 589 333.42 87% 90% 96% 87%
spectral-norm
source secs mem gz cpu cpu load
Ruby 132.22 54,944 862 494.13 94% 95% 93% 92%
Python 3 193.86 50,556 443 757.23 98% 98% 99% 99%
fasta
source secs mem gz cpu cpu load
Ruby 55.67 104,364 1069 96.83 53% 24% 78% 22%
Python 3 62.88 680,736 1947 141.15 60% 56% 48% 62%
regex-redux
source secs mem gz cpu cpu load
Ruby 14.10 268,288 751 19.01 66% 54% 91% 72%
Python 3 15.56 439,964 512 27.97 25% 92% 32% 32%
pidigits
source secs mem gz cpu cpu load
Ruby 3.29 277,496 485 6.58 8% 63% 32% 100%
Python 3 3.51 10,500 386 3.50 1% 1% 0% 100%
fannkuch-redux
source secs mem gz cpu cpu load
Ruby 581.68 36,872 1454 2,272.55 99% 94% 99% 99%
Python 3 547.23 48,052 950 2,162.70 99% 100% 97% 100%
k-nucleotide
source secs mem gz cpu cpu load
Ruby 104.85 383,724 880 386.32 96% 88% 99% 86%
Python 3 79.79 250,948 1967 309.42 98% 96% 96% 99%
mandelbrot
source secs mem gz cpu cpu load
Ruby 482.93 144,684 954 1,926.62 100% 100% 100% 100%
Python 3 279.68 49,344 688 1,117.29 100% 100% 100% 100%
reverse-complement
source secs mem gz cpu cpu load
Ruby 31.20 500,680 264 63.08 86% 59% 52% 7%
Python 3 16.76 1,005,252 814 20.08 65% 21% 44% 17%
Ruby

ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-linux]

Python 3

Python 3.7.0