|
Avoid using Lua in "every frame" actions as performance drops dramatically. For example, don't use Lua to do animation updates; set up parameters for the animation in Lua and do the updates in C/C++ code.
Yes!! I wish I'd had someone warn me six months ago. :) I'm still not sure why Lua seems to perform very respectably for reactive tasks and even a lot of general-purpose crunching but REALLY starts to drag when doing even a few rather simple tasks /every/ frame. Perhaps the setup of invoking Lua from C is fairly heavy (I suspect not) or it's a more subtle issue such as Lua thrashing the memory caches. I love and use Lua, but I'm in the middle of some rearchitecting at the moment because I discovered the above truism the hard way pretty late. :) --Adam -- Adam D. Moss . ,,^^ adam@gimp.org http://www.foxbox.org/ co:3