÷

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

This chart shows 3 comparisons - Time-used, Memory-used and Code-used.

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


 2 : Are the Lua programs faster? Approximately.

This table shows 3 comparisons - Time-used, Memory-used and Code-used.

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

 Lua used what fraction? used how many times more? 
Benchmark Time Memory Code Reduced N
 mandelbrot1/21
 fasta1/61/2±
 n-body1/31/2±
 binary-trees1/2±
 spectral-norm±1/71/3
 pidigits±1/2±
 fannkuch1/8±
 k-nucleotide1/4±
 reverse-complement±

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

 3 : Are the Lua programs faster? Measurements.

This table shows 5 measurements - CPU Time, Elapsed Time, Memory, Code and ~ CPU Load.

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

Program Source Code CPU secs Elapsed secs Memory KB Code B ~ CPU Load
 mandelbrot 
Lua739.60199.7820,712607  83% 100% 87% 100%
Perl4,226.424,226.214,136311  0% 0% 100% 0%
 fasta 
Lua51.7251.721,4481039  0% 0% 100% 0%
Perl314.46314.462,548934  100% 0% 0% 0%
 n-body 
Lua506.52506.491,0961265  0% 0% 0% 100%
Perl1,665.131,665.142,5681140  0% 0% 100% 0%
 binary-trees 
Lua657.04657.001,688,964443  0% 1% 0% 100%
Perl1,276.891,276.851,091,276541  0% 0% 100% 0%
 spectral-norm 
Lua190.68190.701,492329  61% 38% 0% 0%
Perl1,137.10285.5510,976846  100% 100% 100% 100%
 pidigits 
Lua5.145.151,728477  0% 0% 100% 0%
Perl7.467.463,868385  100% 0% 0% 0%
 fannkuch 
Lua1,858.611,858.511,076492  0% 0% 0% 100%
Perl3,749.89942.908,808471  99% 100% 100% 100%
 k-nucleotide 
Lua204.16204.16670,800613  0% 0% 0% 100%
Perl256.1578.582,883,780648  81% 71% 88% 84%
 reverse-complement 
Lua19.1719.17538,784538  0% 0% 100% 0%
Perl5.255.25431,496298  100% 0% 0% 0%
 chameneos-redux
   No program
 regex-dna
   No program

 Lua : associative arrays for extensible embedded scripting 

online book "Programming in Lua" by Roberto Ierusalimschy

"the evolution of Lua" (pdf slides)

Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio

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

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

Revised BSD license