The Computer Language
24.12 Benchmarks Game

Node.js versus Lua fastest performance

How the programs are written matters! 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
Node.js #5 11.05 101,616 1320 43.85
Node.js #8 58.06 51,484 452 58.05
Lua 603.40 19,652 469 603.36
n-body
source secs mem gz cpu secs
Node.js #6 8.55 54,100 1274 8.56
Node.js #8 9.58 53,716 1173 9.59
Lua #2 220.08 19,656 1200 220.07
Lua #4 223.32 19,656 1312 223.30
Lua 262.10 19,656 1207 262.08
spectral-norm
source secs mem gz cpu secs
Node.js #7 5.36 53,724 420 5.37
Node.js 5.37 54,808 326 5.39
Node.js #6 1.56 107,280 1002 5.99
Node.js #8 6.49 54,632 355 6.50
Lua 78.68 19,652 335 78.68
mandelbrot
source secs mem gz cpu secs
Node.js #3 4.00 135,476 1128 15.83
Node.js #2 29.36 61,144 422 29.39
Node.js 70.55 55,900 380 70.64
Node.js #8 72.49 56,116 412 72.52
Lua #3 345.71 19,656 364 345.68
Lua 348.76 19,656 365 348.74
Lua #2 376.55 19,656 373 376.53
Lua #6 114.06 282,112 630 400.14
fasta
source secs mem gz cpu secs
* Node.js #5 2.52 112,392 2050 7.08
Node.js #8 18.42 61,784 742 18.61
Lua #3 24.08 19,652 1065 24.08
Lua #2 24.15 19,652 1065 24.14
Node.js 38.40 58,880 815 38.77
k-nucleotide
source secs mem gz cpu secs
Node.js #3 16.48 436,784 1817 44.54
Lua #2 97.17 596,604 620 97.16
Node.js #2 38.24 486,844 941 112.58
Node.js 39.98 356,716 1011 117.63
Node.js #8 144.82 692,816 678 145.44
reverse-complement
source secs mem gz cpu secs
* Node.js #2 15.44 731,804 1228 16.09
Lua #2 41.12 2,654,652 560 41.10
Lua #5 41.96 2,169,636 758 41.96
Lua #4 49.35 1,030,016 600 49.33
* Node.js #7   Bad Output  
binary-trees
source secs mem gz cpu secs
Node.js #7 16.02 1,070,260 458 28.26
Node.js #6 8.60 1,250,816 752 30.68
Node.js #8 19.86 1,334,104 521 32.74
Node.js 8.92 1,405,276 717 33.60
Lua #2 141.55 956,672 418 141.52
Lua #3 83.71 809,856 690 167.26
Lua #4 48.65 956,672 670 180.27
pidigits
source secs mem gz cpu secs
Node.js #4 1.11 59,620 487 1.14
Node.js #2 12.16 87,228 405 12.19
Node.js #3 12.25 87,708 431 12.28
* Lua #7   Failed  
* Lua #5   Failed  
* Lua   Failed  
regex-redux
source secs mem gz cpu secs
Node.js #3 4.27 796,080 675 5.30
Node.js #4 5.41 978,952 471 5.56
Lua   Failed  
Node.js

v23.0.0

Lua

Lua 5.4.6 Copyright (C)
1994-2023 Lua.org, PUC-Rio