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.83 433,920 1107 177.53 79% 94% 87% 78%
Python 3 93.40 449,328 589 336.54 88% 92% 94% 89%
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%
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.12 500,868 264 62.94 47% 60% 40% 57%
Python 3 16.76 1,005,252 814 20.08 65% 21% 44% 17%
pidigits
source secs mem gz cpu cpu load
Ruby 31.64 167,496 518 64.02 46% 55% 36% 68%
Python 3 3.51 10,500 386 3.50 1% 1% 0% 100%
Ruby

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

Python 3

Python 3.7.0