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.

regex-redux
source secs mem gz busy cpu load
Lua 4.36 339,520 482 4.43 0% 0% 1% 100%
Ruby 15.97 277,888 726 33.81 41% 76% 59% 36%
pidigits
source secs mem gz busy cpu load
Lua 1.94 4,056 479 2.02 2% 2% 100% 1%
Ruby 3.23 380,036 485 4.90 12% 50% 52% 37%
mandelbrot
source secs mem gz busy cpu load
Lua 256.77 22,712 623 899.10 99% 86% 87% 78%
Ruby 335.33 66,188 931 1,339.92 100% 100% 100% 100%
fasta
source secs mem gz busy cpu load
Lua 51.34 3,056 1061 51.87 0% 0% 1% 100%
Ruby 51.74 123,240 1069 55.08 43% 44% 2% 17%
n-body
source secs mem gz busy cpu load
Lua 406.77 1,368 1305 412.06 0% 0% 1% 100%
Ruby 374.51 25,668 1137 387.63 67% 20% 2% 14%
spectral-norm
source secs mem gz busy cpu load
Lua 192.80 2,872 329 199.44 15% 85% 1% 2%
Ruby 150.32 26,188 839 585.35 97% 97% 97% 97%
k-nucleotide
source secs mem gz busy cpu load
Lua 189.90 521,716 613 191.07 1% 0% 99% 1%
Ruby 103.71 400,128 859 377.05 95% 85% 95% 89%
binary-trees
source secs mem gz busy cpu load
Lua 154.13 1,084,256 664 485.35 76% 71% 87% 81%
Ruby 44.61 531,600 1096 125.16 67% 72% 60% 81%
reverse-complement
source secs mem gz busy cpu load
Lua 77.65 2,932,848 553 77.85 26% 1% 4% 69%
Ruby 20.99 1,611,616 295 27.84 98% 7% 18% 9%
fannkuch-redux
source secs mem gz busy cpu load
Lua 1,317.39 1,340 462 1,339.50 0% 100% 1% 1%
Ruby 303.19 26,680 1444 1,169.40 100% 91% 98% 97%
Lua

Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio

Ruby

ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
--jit