[JW Lua] Slow JW Lua Scripts and Profiler

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Wed Sep 3 10:03:58 CEST 2014


Hello All!

For slow-running JW Lua scripts, I suggest using a profiler to see the 
lines of code where it could be optimized.

I found a Lua profiler that works very well, called "ProFi". It's 
available here:
https://gist.github.com/perky/2838755

Save the ProFi.lua script to your hard drive and add the path to the 
"require" list in the JW Lua Preferences. Put the start() and stop() 
command just around where the real processing of your script occurs.

Mac users: Please note that this will currently give inaccurate results 
on the Mac, since Lua's os.time() function only return seconds on the 
Mac. I hope to include a high resolution timer for both Windows and Mac 
in the next beta. (ProFi supports custom timers through the 
setGetTimeMethod() method.)


Best regards,

Jari Williamsson





More information about the JWLua mailing list