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 Java 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 Java 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
 pidigits1/2 1/2
 regex-dna±1/21/2
 k-nucleotide1/21/3
 fasta 1/2
 reverse-complement11×±
 spectral-norm15× 1/2
 n-body20× ±
 binary-trees27×±
 mandelbrot28× 1/2
 fannkuch-redux30× 1/3
 Lua used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/21/213×27×30×30×

± 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 Java program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 pidigits 
Lua1.931.941,932479  0% 1% 1% 100%
Java3.153.1528,972938  1% 0% 2% 100%
 regex-dna 
Lua19.2619.27346,052669  0% 0% 0% 100%
Java20.9420.95567,2761377  2% 9% 1% 100%
 k-nucleotide 
Lua192.80194.92707,636613  0% 0% 0% 100%
Java34.7834.841,119,0841844  0% 1% 1% 100%
 fasta 
Lua44.5944.601,4801049  0% 0% 0% 100%
Java5.355.3632,9162457  0% 1% 1% 100%
 reverse-complement 
Lua18.3418.37796,612555  0% 0% 0% 100%
Java1.631.63524,612745  0% 2% 1% 99%
 spectral-norm 
Lua252.65252.721,288329  0% 0% 0% 100%
Java17.0917.1025,552514  1% 0% 0% 100%
 n-body 
Lua450.40450.511,0401305  0% 0% 0% 100%
Java22.6722.6723,8121424  1% 0% 1% 100%
 binary-trees 
Lua461.01461.641,776,376446  0% 0% 0% 100%
Java16.8416.87515,100584  0% 1% 1% 100%
 mandelbrot 
Lua660.73660.911,320353  0% 0% 0% 100%
Java23.8623.8788,200796  1% 0% 1% 100%
 fannkuch-redux 
Lua2,111.252,111.771,016462  0% 0% 0% 100%
Java69.8769.8841,3361282  0% 0% 0% 100%
 fasta-redux 
No program
Java0.180.18?1443  0% 0% 0% 100%

 4 : Are there other Lua programs for these benchmarks?

Remember - those are just the fastest Lua and Java 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 Java 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