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 110.91 8,024 977 110.87 100% 1% 1% 1%
n-body
source secs mem gz cpu cpu load
Lua 389.29 1,176 1193 389.20 0% 1% 1% 100%
Python 3 787.02 7,744 1181 786.82 0% 1% 0% 100%
mandelbrot
source secs mem gz cpu cpu load
Lua 201.89 23,560 623 696.14 84% 94% 85% 83%
Python 3 273.43 53,416 686 1,091.35 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 188.83 54,524 437 750.46 99% 100% 100% 99%
k-nucleotide
source secs mem gz cpu cpu load
Lua 182.12 572,508 613 180.68 1% 100% 1% 1%
Python 3 84.73 221,028 1937 276.97 97% 93% 91% 91%
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 483.79 51,896 944 1,880.10 97% 94% 100% 99%
binary-trees
source secs mem gz cpu cpu load
Lua 364.38 2,194,388 412 363.90 38% 28% 36% 1%
Python 3 86.90 451,548 581 306.31 89% 97% 87% 89%
reverse-complement
source secs mem gz cpu cpu load
Lua 17.44 740,584 553 17.43 100% 1% 1% 0%
Python 3 2.82 265,428 800 4.18 46% 32% 20% 54%
regex-redux
source secs mem gz cpu cpu load
Lua   Bad Output
Python 3 0.36 40,008 486 0.39 20% 61% 25% 19%
pidigits
source secs mem gz cpu cpu load
Lua 0.13 ? 479 0.08 0% 100% 8% 0%
Python 3   Failed
Lua

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

Python 3

Python 3.6.1 (default, Apr 18 2017, 10:33:41)
[GCC 6.3.0 20170406]
--enable-optimizations --with-lto
make profile-opt