/mobile Handheld Friendly website

vs

 1 : Are the Lua programs faster? At a glance.

Each chart bar shows, for one unidentified benchmark, how much the fastest Lua program used compared to the fastest JavaScript V8 program.

(Memory use is only compared for tasks that require memory to be allocated.)


These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples.

 2 : Are the Lua programs faster? Approximately.

Each table row shows, for one named benchmark, how much the fastest Lua program used compared to the fastest JavaScript V8 program.

(Memory use is only compared for tasks that require memory to be allocated.)

 Lua used what fraction? used how many times more? 
Benchmark Time Memory Code
 k-nucleotide19×1/2
 reverse-complement±
 fasta ±
 regex-dna1/2
 n-body11× ±
 binary-trees11×±
 spectral-norm16× ±
 fannkuch-redux28× ±
 Lua used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)13×28×28×

± read the measurements and then read the program source code.

 3 : Are the Lua programs faster? Measurements.

These are not the only tasks that could be solved. These are just 10 tiny examples. These are not the only compilers and interpreters. These are not the only programs that could be written.

For each named benchmark, measurements of the fastest Lua program are shown for comparison against measurements of the fastest JavaScript V8 program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 k-nucleotide 
Lua220.11220.81707,928613  0% 0% 0% 100%
JavaScript V896.3096.3938,0761249  0% 1% 1% 100%
 reverse-complement 
Lua22.4922.51724,576555  0% 0% 0% 100%
JavaScript V89.179.18240,648787  0% 0% 1% 100%
 fasta 
Lua49.7149.721,1121049  0% 1% 0% 100%
JavaScript V817.6417.658,472791  1% 0% 0% 100%
 regex-dna 
Lua19.6919.71224,592669  0% 0% 0% 100%
JavaScript V83.853.86406,048373  1% 1% 0% 100%
 n-body 
Lua461.37461.478361193  0% 0% 0% 100%
JavaScript V842.1242.138,6401527  0% 0% 0% 100%
 binary-trees 
Lua449.99450.481,033,624446  0% 14% 4% 100%
JavaScript V839.8639.92267,848467  0% 1% 1% 100%
 spectral-norm 
Lua243.58243.64940329  0% 0% 0% 100%
JavaScript V815.7015.718,340328  0% 1% 1% 100%
 fannkuch-redux 
Lua2,131.112,131.55820462  0% 0% 0% 100%
JavaScript V875.0275.046,300539  0% 0% 0% 100%
 pidigits 
Lua0.100.11?479  0% 0% 9% 100%
No program
 mandelbrot 
Lua3.163.17820353  0% 0% 1% 100%
JavaScript V8Bad Output
 fasta-redux
   No programs

 4 : Are there other Lua programs for these benchmarks?

Remember - those are just the fastest Lua and JavaScript V8 programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Lua.

Maybe one of those other Lua programs is fastest on a different OS/machine.

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Lua and JavaScript V8 programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.

Maybe one of those other programs is fastest on a different OS/machine.

 Lua : associative arrays for extensible embedded scripting 

online book "Programming in Lua" by Roberto Ierusalimschy

"Game Developers Conference 2010 Lua Tutorial" (slides)

Lua 5.2.1 Copyright (C) 1994-2012 Lua.org, PUC-Rio

Home Page: http://www.lua.org/

Download: http://www.lua.org/download.html

Revised BSD license

  Home   Conclusions   License   Play