The Computer Language
Benchmarks Game

Lua programs versus Python 3

by benchmark task performance

fasta
source secs mem gz cpu cpu load
Lua 45.92 2,828 1052 45.90 100% 1% 1% 0%
Python 3 113.03 7,860 977 112.99 1% 100% 0% 1%
n-body
source secs mem gz cpu cpu load
Lua 389.29 1,176 1193 389.20 0% 1% 1% 100%
Python 3 836.27 7,756 1181 836.06 0% 1% 1% 100%
pidigits
source secs mem gz cpu cpu load
Lua 1.94 3,248 479 1.93 1% 1% 1% 99%
Python 3 3.41 9,992 382 3.40 1% 2% 100% 1%
mandelbrot
source secs mem gz cpu cpu load
Lua 201.89 23,560 623 696.14 84% 94% 85% 83%
Python 3 250.62 52,752 686 1,000.26 100% 100% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
Lua 180.25 2,628 329 180.20 100% 1% 1% 0%
Python 3 180.01 55,892 437 714.86 99% 100% 99% 100%
k-nucleotide
source secs mem gz cpu cpu load
Lua 182.12 572,508 613 180.68 1% 100% 1% 1%
Python 3 72.35 229,040 1937 268.72 98% 94% 91% 94%
fannkuch-redux
source secs mem gz cpu cpu load
Lua 1,315.48 1,284 462 1,315.20 53% 0% 47% 0%
Python 3 501.72 54,708 944 1,967.92 98% 97% 100% 99%
binary-trees
source secs mem gz cpu cpu load
Lua 418.26 1,716,904 446 417.72 21% 13% 68% 1%
Python 3 126.07 831,740 596 474.55 93% 93% 93% 99%
reverse-complement
source secs mem gz cpu cpu load
Lua 17.44 740,584 553 17.43 100% 1% 1% 0%
Python 3 2.93 265,636 800 4.28 80% 46% 21% 2%
regex-redux
source secs mem gz cpu cpu load
Lua   Bad Output
Python 3 1.07 ? 486 ? 5% 75% 17% 13%
Lua

Lua 5.3.3 Copyright (C) 1994-2016 Lua.org, PUC-Rio

Python 3

Python 3.6.0 (default, Feb 5 2017, 10:29:14) [GCC 5.4.0 20160609] on linux
--enable-optimizations
make profile-opt