The Computer Language
Benchmarks Game

Perl versus Ruby fastest programs

Always look at the source code.

These are only the fastest programs. Do some of them use manually vectorized SIMD? Look at the other programs. They may seem more-like a fair comparison to you.

spectral-norm
source secs mem gz busy cpu load
Perl 24.69 12,188 555 96.59 97% 99% 98% 97%
Ruby 118.16 24,764 326 120.08 0% 1% 100% 0%
k-nucleotide
source secs mem gz busy cpu load
Perl 37.72 1,255,884 652 131.45 88% 89% 87% 85%
Ruby 77.22 146,188 576 271.55 81% 84% 93% 93%
reverse-complement
source secs mem gz busy cpu load
Perl 6.36 1,495,132 287 6.52 0% 0% 2% 100%
Ruby 11.45 2,009,880 482 21.50 34% 70% 57% 26%
pidigits
source secs mem gz busy cpu load
Perl 1.90 8,268 261 2.16 100% 2% 3% 9%
Ruby 2.11 541,320 485 4.16 53% 6% 100% 39%
regex-redux
source secs mem gz busy cpu load
Perl 10.10 157,208 820 31.98 96% 67% 93% 61%
Ruby 9.66 277,900 724 21.43 44% 96% 38% 43%
mandelbrot
source secs mem gz busy cpu load
Perl 542.82 45,036 586 2,169.30 100% 100% 100% 100%
Ruby 262.79 69,328 880 1,049.78 100% 100% 100% 100%
fannkuch-redux
source secs mem gz busy cpu load
Perl 392.54 12,116 570 1,568.84 100% 100% 100% 100%
Ruby 181.72 26,276 1455 716.75 99% 100% 99% 96%
binary-trees
source secs mem gz busy cpu load
Perl 53.02 1,048,568 797 195.75 91% 88% 100% 90%
Ruby 23.80 566,560 1008 67.07 58% 96% 63% 64%
n-body
source secs mem gz busy cpu load
Perl 419.75 6,388 1429 429.50 1% 1% 1% 100%
Ruby 188.10 23,088 1163 191.79 0% 1% 1% 100%
fasta
source secs mem gz busy cpu load
Perl 58.08 55,188 871 59.16 1% 100% 1% 0%
Ruby 25.63 120,804 1069 28.41 0% 10% 100% 1%
Perl

This is perl 5, version 32, subversion 0 (v5.32.0)
built for x86_64-linux-thread-multi

Ruby

ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
--jit