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 387.73 16,196 1137 433.22 48% 4% 10% 51%
Python 3 850.24 7,916 1242 850.06 0% 0% 0% 100%
binary-trees
source secs mem gz cpu cpu load
Ruby 64.07 488,156 1107 218.34 98% 78% 90% 83%
Python 3 83.95 451,732 589 290.57 88% 87% 87% 97%
pidigits
source secs mem gz cpu cpu load
Ruby 3.42 289,440 485 6.88 64% 38% 100% 4%
Python 3 3.47 10,364 386 3.47 0% 1% 100% 0%
fasta
source secs mem gz cpu cpu load
Ruby 63.32 98,996 1069 106.23 39% 28% 61% 42%
Python 3 63.19 680,688 1947 135.52 62% 70% 63% 22%
fannkuch-redux
source secs mem gz cpu cpu load
Ruby 545.63 14,968 1454 2,111.38 94% 97% 97% 100%
Python 3 507.56 50,988 950 1,998.88 99% 99% 97% 99%
spectral-norm
source secs mem gz cpu cpu load
Ruby 237.96 18,312 326 280.55 97% 4% 6% 12%
Python 3 182.12 52,752 443 705.87 96% 96% 96% 100%
regex-redux
source secs mem gz cpu cpu load
Ruby 23.58 269,664 751 25.12 79% 68% 74% 85%
Python 3 16.98 445,760 512 31.44 28% 74% 47% 38%
reverse-complement
source secs mem gz cpu cpu load
Ruby 23.09 1,604,952 295 40.79 59% 45% 35% 40%
Python 3 16.03 1,007,016 814 19.29 18% 59% 44% 23%
mandelbrot
source secs mem gz cpu cpu load
Ruby 452.81 59,660 954 1,805.81 100% 100% 100% 100%
Python 3 263.04 51,780 688 1,050.80 100% 100% 100% 100%
k-nucleotide
source secs mem gz cpu cpu load
Ruby 189.81 137,920 667 714.29 94% 97% 96% 91%
Python 3 72.80 189,720 1967 276.09 95% 96% 98% 94%
Ruby

ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
--jit

Python 3

Python 3.7.1