The Computer Language
Benchmarks Game

Lua versus Python 3 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.

n-body
source secs mem gz busy cpu load
Lua 406.77 1,368 1305 412.06 0% 0% 1% 100%
Python 3 865.18 8,176 1196 874.96 2% 20% 79% 0%
fasta
source secs mem gz busy cpu load
Lua 51.34 3,056 1061 51.87 0% 0% 1% 100%
Python 3 63.55 844,180 1947 129.71 40% 71% 33% 61%
pidigits
source secs mem gz busy cpu load
Lua 1.94 4,056 479 2.02 2% 2% 100% 1%
Python 3 2.38 12,120 567 2.44 0% 3% 1% 98%
mandelbrot
source secs mem gz busy cpu load
Lua 256.77 22,712 623 899.10 99% 86% 87% 78%
Python 3 259.50 48,192 688 1,036.70 100% 100% 100% 100%
spectral-norm
source secs mem gz busy cpu load
Lua 192.80 2,872 329 199.44 15% 85% 1% 2%
Python 3 169.87 49,188 417 675.02 100% 99% 99% 99%
binary-trees
source secs mem gz busy cpu load
Lua 154.13 1,084,256 664 485.35 76% 71% 87% 81%
Python 3 80.30 448,004 589 286.50 95% 87% 87% 88%
regex-redux
source secs mem gz busy cpu load
Lua 4.36 339,520 482 4.43 0% 0% 1% 100%
Python 3 2.12 111,692 1403 4.20 35% 41% 88% 34%
fannkuch-redux
source secs mem gz busy cpu load
Lua 1,317.39 1,340 462 1,339.50 0% 100% 1% 1%
Python 3 534.40 47,236 950 2,104.05 99% 97% 99% 99%
k-nucleotide
source secs mem gz busy cpu load
Lua 189.90 521,716 613 191.07 1% 0% 99% 1%
Python 3 72.24 199,856 1967 275.38 94% 94% 96% 96%
reverse-complement
source secs mem gz busy cpu load
Lua 77.65 2,932,848 553 77.85 26% 1% 4% 69%
Python 3 16.93 1,777,852 434 17.58 78% 21% 4% 0%
Lua

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

Python 3

Python 3.8.0