lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Am Dienstag, 23. Februar 2010 11:50:02 schrieb steve donovan:
> On Tue, Feb 23, 2010 at 12:43 PM, Torsten K. <agonizer@gmx.de> wrote:
> > The same with local:
> Yow, that's quite a fat difference!
> 
> But how would this do, to complete the local figures?
> 
>  time lua -e "local append=table.insert; local a={};for i=1,20000000
> do append(a,i) end"
> 
> steve d.

Its a minor improvement :-)

tk@gentoo-c2q ~ $ time lua -e "local a={};for i=1,20000000 do 
table.insert(a,i) end"
real    0m7.143s
user    0m6.862s

tk@gentoo-c2q ~ $ time lua -e "local a,append={},table.insert; for 
i=1,20000000 do append(a,i) end"
real    0m6.678s
user    0m6.406s


Bye,
  Torsten