The Computer Language
23.02 Benchmarks Game

Lua versus Python 3 fastest performance

Always look at the source code.

If the fastest programs are hand-written vector instructions, does the host language matter? You might be more interested in the less optimised programs — more seconds, less gz source code.

fannkuch-redux
source secs mem gz cpu secs
Lua 682.73 10,804 462 682.65
Python 3 #6 913.87 11,080 385 913.83
Python 3 #4 285.20 14,264 950 1,123.47
n-body
source secs mem gz cpu secs
Lua #2 229.78 10,808 1193 229.75
Lua #4 232.46 10,808 1305 232.43
Lua 254.76 10,808 1201 254.73
Python 3 383.12 11,096 1196 383.11
Python 3 #2 402.59 11,096 1242 402.57
spectral-norm
source secs mem gz cpu secs
Lua 80.44 10,812 329 80.43
Python 3 #8 78.36 15,704 407 311.22
Python 3 #6 315.69 11,200 328 315.68
Python 3 #7 89.17 15,516 417 352.71
mandelbrot
source secs mem gz cpu secs
Lua 248.57 10,804 359 248.45
Lua #3 248.71 10,804 358 248.58
Lua #2 278.69 10,804 367 278.60
Lua #6 83.70 282,188 623 291.04
Python 3 #7 155.28 14,244 688 616.01
Python 3 #2   Timed Out  
Python 3 #5   Failed  
pidigits
source secs mem gz cpu secs
Python 3 #3 1.25 13,564 567 1.25
Python 3 #4 4.21 11,096 342 4.21
Lua   Failed  
Lua #5   Failed  
Python 3 #2   Bad Output  
Lua #7   Failed  
regex-redux
source secs mem gz cpu secs
Python 3 #2 1.38 168,144 1403 2.65
Python 3 8.02 460,684 512 14.90
Lua   Failed  
fasta
source secs mem gz cpu secs
Lua #2 26.26 10,804 1061 26.26
Lua #3 26.28 10,804 1061 26.27
Python 3 #2 49.99 11,088 1121 49.99
Python 3 #3 50.28 11,088 1003 50.27
Python 3 58.84 11,092 817 58.84
Python 3 #5 33.40 827,232 1947 61.49
k-nucleotide
source secs mem gz cpu secs
Lua #2 113.00 596,368 613 112.94
Python 3 #3 44.13 262,348 1967 165.01
Python 3 58.56 379,464 607 211.98
Python 3 #8 69.21 505,836 655 214.24
reverse-complement
source secs mem gz cpu secs
Python 3 #3 4.96 508,412 796 4.95
Python 3 #5 3.72 1,500,212 954 6.76
Python 3 8.53 1,986,544 479 8.53
Python 3 #2 8.58 1,788,056 434 8.58
Python 3 #6 6.17 2,484,084 814 9.23
Python 3 #4 12.04 4,002,656 335 12.04
Lua #2 42.06 2,654,608 553 42.05
Lua #5 43.98 2,169,452 719 43.97
Lua #4 53.18 1,029,636 594 53.12
binary-trees
source secs mem gz cpu secs
Python 3 #2 104.73 271,980 338 104.72
Python 3 #5 35.33 274,884 660 125.79
Python 3 #4 34.53 276,752 472 125.93
Python 3 35.93 276,952 589 126.44
Lua #2 142.37 963,576 412 142.35
Python 3 #3 50.99 672,016 1238 142.94
Lua #3 83.64 927,420 684 166.50
Lua #4 49.08 927,412 664 180.68
Lua

Lua 5.4.4 Copyright (C)
1994-2022 Lua.org, PUC-Rio

Python 3

Python 3.11.1