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 210.66 1,092 1305 212.11 0% 0% 0% 100%
Python 3 545.25 8,160 1196 558.88 1% 1% 1% 100%
mandelbrot
source secs mem gz busy cpu load
Lua 87.88 17,912 623 304.22 86% 84% 100% 77%
Python 3 170.25 47,568 688 680.12 100% 100% 100% 100%
spectral-norm
source secs mem gz busy cpu load
Lua 87.18 2,696 329 87.66 0% 100% 0% 0%
Python 3 124.52 49,872 417 484.76 97% 97% 97% 97%
fasta
source secs mem gz busy cpu load
Lua 28.30 2,784 1061 28.49 1% 0% 100% 0%
Python 3 38.07 845,888 1947 75.85 23% 63% 66% 47%
binary-trees
source secs mem gz busy cpu load
Lua 50.05 896,096 664 186.88 91% 93% 98% 92%
Python 3 48.45 448,980 589 171.58 86% 86% 87% 94%
fannkuch-redux
source secs mem gz busy cpu load
Lua 712.89 1,144 462 717.18 0% 100% 0% 0%
Python 3 366.43 47,608 950 1,448.16 100% 99% 100% 97%
k-nucleotide
source secs mem gz busy cpu load
Lua 118.07 591,920 613 118.65 0% 0% 100% 0%
Python 3 48.51 134,372 1967 185.66 94% 100% 94% 95%
reverse-complement
source secs mem gz busy cpu load
Lua 42.04 2,120,492 752 42.26 0% 0% 30% 70%
Python 3 7.15 1,005,204 814 10.62 81% 1% 47% 20%
regex-redux
source secs mem gz busy cpu load
Lua   Failed
Python 3 1.37 404,320 1403 2.65 32% 41% 33% 88%
pidigits
source secs mem gz busy cpu load
Lua   Failed
Python 3 1.29 11,976 567 1.30 0% 100% 1% 0%
Lua

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

Python 3

Python 3.8.3