lua-users home
lua-l archive

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

Which system are you developing for?

Unless it's embedded, the move to float probably won't make much difference at all. And if it's embedded, using LNUM patch (I know you said no C, does that include no patching as well?) will make more difference, and make it easier to try out effects of different number modes.

Have you gone through the easy and obvious: using locals where-ever you can instead of globals?

If you're on x86 system, why not try LuaJIT.  It'd probably give you the most speedup.

About details on any of these, check the archives:

At the end it comes to understanding your module's behaviour, most likely measuring it somehow, and fine tuning the most important parts. You may not be spared of going to C; why is that so no-no?


Andrew Yount kirjoitti 11.8.2008 kello 22:03:

One relatively simple thing you can do is switch the default number type (lua_Number) from double to float.  Depending on your platform, this can make a significant improvement in performance.  Of course, this requires that your use of Lua would be tolerant of lower precision numbers.
Also, Lua has a couple assert-like validation macros – make sure those are disabled (unless you’re trying to debug something).  I can’t remember the specific macro names off the top of my head.
-Andrew Yount
From: [] On Behalf Of Manish Jain
Sent: Monday, July 21, 2008 5:33 AM
To: Lua list
Subject: Lua: Performance
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.
Best Regards,
Manish Jain