lua-users home
lua-l archive

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


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Thomas Lauer
Sent: Monday, July 21, 2008 6:31 PM
To: Lua list
Subject: Re: Lua: Performance


"Manish Jain" <[email protected]> wrote:
> 
> I understand that it is not logical to compare performance of Lua(or
any
> scripting) language with an application programming languages(like C),
> but I am struggling to improve performance of my Lua module. I
> understand that 'luac' does not help to improve performance. Do we
have
> something in same direction to improve lua performance? Anything
except
> moving to C will help.

>>> 0. Check your algorithms.
>>> 1. Use locals wherever possible.
>>> 2. Use LuaJIT.
>>> 3. Profile and code the bottlenecks (or have them coded) in C.

>>> Is there a thread or a Wiki entry with the collected wisdom on how
to
>>> optimise and speed up Lua scripts? Ages ago, I looked for something
like
>>> that and found not a lot. IIRC, I was told that the forthcoming Gems
>>> book will have a chapter about this (done by Roberto, I think).

>>> -- 
>>> cheers  thomasl
>>> web: http://thomaslauer.com/start

1) how serious is global variables wrt performance?
2) we tried LuaJIT. It gives 30-40% performance improvement on simple
Lua code. But, in case of actual code(which involves access to some
in-memory DB (mcO) and other C call), it is not giving any improvement.
Any suggestions!

- Manish Jain