The Computer Language
Benchmarks Game

Ruby versus Python 3 fastest programs

by faster benchmark performance

binary-trees
source secs mem gz cpu cpu load
Ruby 38.36 468,512 1107 115.36 73% 70% 94% 66%
Python 3 83.95 451,732 589 290.57 88% 87% 87% 97%
n-body
source secs mem gz cpu cpu load
Ruby 389.78 16,440 1137 434.87 13% 90% 6% 3%
Python 3 850.24 7,916 1242 850.06 0% 0% 0% 100%
spectral-norm
source secs mem gz cpu cpu load
Ruby 157.09 86,412 862 594.51 96% 94% 95% 94%
Python 3 182.12 52,752 443 705.87 96% 96% 96% 100%
regex-redux
source secs mem gz cpu cpu load
Ruby 15.16 269,680 751 18.83 72% 50% 89% 65%
Python 3 16.98 445,760 512 31.44 28% 74% 47% 38%
pidigits
source secs mem gz cpu cpu load
Ruby 3.39 274,164 485 6.82 58% 15% 90% 43%
Python 3 3.48 10,352 386 3.47 1% 1% 0% 100%
fasta
source secs mem gz cpu cpu load
Ruby 63.70 98,956 1069 106.36 69% 54% 15% 30%
Python 3 63.19 680,688 1947 135.52 62% 70% 63% 22%
fannkuch-redux
source secs mem gz cpu cpu load
Ruby 583.02 58,756 1454 2,266.89 100% 100% 99% 90%
Python 3 507.56 50,988 950 1,998.88 99% 99% 97% 99%
reverse-complement
source secs mem gz cpu cpu load
Ruby 23.53 1,605,140 295 41.31 51% 54% 31% 61%
Python 3 16.03 1,007,016 814 19.29 18% 59% 44% 23%
k-nucleotide
source secs mem gz cpu cpu load
Ruby 108.90 387,100 880 378.11 84% 85% 96% 84%
Python 3 72.80 189,720 1967 276.09 95% 96% 98% 94%
mandelbrot
source secs mem gz cpu cpu load
Ruby 482.17 96,460 1044 1,914.71 100% 100% 100% 100%
Python 3 263.04 51,780 688 1,050.80 100% 100% 100% 100%
Ruby

ruby 2.6.0preview3 (2018-11-06 trunk 65578) [x86_64-linux]

Python 3

Python 3.7.1