[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Lua: Performance
- From: "Manish Jain" <manish.jain@...>
- Date: Fri, 25 Jul 2008 18:34:17 +0530
[mailto:firstname.lastname@example.org] On Behalf Of Thomas Lauer
Sent: Monday, July 21, 2008 6:31 PM
To: Lua list
Subject: Re: Lua: Performance
"Manish Jain" <email@example.com> wrote:
> I understand that it is not logical to compare performance of Lua(or
> 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
> something in same direction to improve lua performance? Anything
> 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
>>> optimise and speed up Lua scripts? Ages ago, I looked for something
>>> 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.
- Manish Jain