lua-users home
lua-l archive

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


Evan DeMond wrote:
> As I'm sure someone is going to jump in here and say at some point:
> 
> Use local variables. Global variable lookups have a slight overhead that
> adds up into a greater performance penalty as you hit them over and
> over, especially in loops. Your benchmarks aren't really showing what
> Lua can do if you're not using locals where they're needed.

This should help...
http://lua-users.org/wiki/OptimisationCodingTips

It should be said that Lua isn't meant for truly serious number
crunching. One would choose Lua for number crunching not for raw
performance reasons. People use Perl to crunch GBs of httpd log
data and spew out statistics. It can be a few times slower than a
C/C++ solution. No big deal, people would still use Perl. Same
thing here.

By all means generate and optimize the benchmark results and study
the benchmark, but I hope the OP does not take it too seriously...

> Evan
> 
> On Mon, Mar 10, 2008 at 10:59 AM, Mister White <misterwhite81@yahoo.it
> <mailto:misterwhite81@yahoo.it>> wrote:
> [snip]

-- 
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia