/mobile Handheld Friendly website

÷

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


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

 Lua used what fraction? used how many times more? 
Benchmark Time Memory Code
 pidigits1/31/321/4
 regex-dna±1/3
 k-nucleotide±1/3
 fasta10×1/13±
 reverse-complement12×±±
 spectral-norm15×1/161/3
 n-body19×1/17±
 binary-trees29×±
 mandelbrot29×1/651/2
 fannkuch-redux30×1/171/3
 Lua used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/31/313×29×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 7 program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 pidigits 
Lua2.512.521,460479  0% 1% 1% 100%
Java 77.337.3447,4401826  0% 0% 0% 100%
 regex-dna 
Lua43.9043.94494,992437  0% 0% 0% 100%
Java 722.6322.66557,0801284  0% 0% 0% 100%
 k-nucleotide 
Lua220.11220.81707,928613  0% 0% 0% 100%
Java 750.6950.73494,0401630  1% 0% 0% 100%
 fasta 
Lua49.7149.721,1121049  0% 1% 0% 100%
Java 74.924.9214,9321507  0% 1% 0% 100%
 reverse-complement 
Lua22.4922.51724,576555  0% 0% 0% 100%
Java 71.881.92511,484745  2% 1% 3% 100%
 spectral-norm 
Lua243.58243.64940329  0% 0% 0% 100%
Java 716.1316.1414,924950  1% 0% 0% 100%
 n-body 
Lua461.37461.478361193  0% 0% 0% 100%
Java 724.4024.4113,9961424  0% 0% 0% 100%
 binary-trees 
Lua449.99450.481,033,624446  0% 14% 4% 100%
Java 715.7015.75506,592603  0% 1% 0% 100%
 mandelbrot 
Lua786.43786.611,044353  0% 0% 0% 100%
Java 726.9226.9367,880796  0% 0% 0% 100%
 fannkuch-redux 
Lua2,131.112,131.55820462  0% 0% 0% 100%
Java 771.2671.2813,9361282  0% 0% 0% 100%
 fasta-redux 
No program
Java 70.120.12?1443  0% 33% 0% 100%

 4 : Are there other Lua programs for these benchmarks?

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