The Computer Language
Benchmarks Game

Lua versus Ruby fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

mandelbrot
source secs mem gz busy cpu load
Lua 86.29 18,496 623 304.76 86% 88% 100% 80%
Ruby 259.25 72,264 931 1,014.80 97% 97% 100% 97%
fannkuch-redux
source secs mem gz busy cpu load
Lua 719.15 1,224 462 723.72 0% 0% 0% 100%
Ruby 1,255.50 25,200 384 1,263.51 100% 0% 0% 0%
spectral-norm
source secs mem gz busy cpu load
Lua 87.25 2,736 329 87.59 0% 0% 100% 0%
Ruby 113.92 25,196 326 115.91 1% 0% 1% 100%
binary-trees
source secs mem gz busy cpu load
Lua 50.85 884,352 664 189.06 92% 97% 91% 92%
Ruby 60.99 875,584 364 63.56 96% 4% 3% 1%
n-body
source secs mem gz busy cpu load
Lua 217.77 1,288 1193 218.86 0% 0% 0% 100%
Ruby 253.50 25,232 1137 258.38 1% 1% 0% 100%
fasta
source secs mem gz busy cpu load
Lua 28.31 2,840 1061 28.57 0% 1% 0% 100%
Ruby 31.29 122,852 1069 34.96 2% 4% 5% 100%
k-nucleotide
source secs mem gz busy cpu load
Lua 119.24 596,500 613 119.78 0% 100% 0% 0%
Ruby 72.19 400,272 859 265.83 100% 88% 95% 86%
reverse-complement
source secs mem gz busy cpu load
Lua 44.41 2,165,032 752 44.52 0% 0% 100% 0%
Ruby 10.58 2,009,736 517 20.20 50% 13% 96% 32%
regex-redux
source secs mem gz busy cpu load
Lua   Failed
Ruby 9.72 332,016 724 21.17 39% 94% 45% 39%
pidigits
source secs mem gz busy cpu load
Lua   Failed
Ruby 2.01 437,692 485 4.06 49% 10% 100% 42%
Lua

Lua 5.4.0 Copyright (C) 1994-2020 Lua.org, PUC-Rio

Ruby

ruby 3.0.0preview1 (2020-09-25 master 0096d2b895) [x86_64-linux]
--jit