Originally Posted by SDPhantom
Calling a Lua function is the most taxing operation you can do. The best you can do is to make sure the game spends the least time possible in Lua code. Even if it's just an empty function.
|
That's interesting. Are you saying that calling a function is significantly more taxing than it would be to execute the function's code "inline"? When I code I try to use functions wherever I can to avoid writing the same code more than once. Does this make my code less efficient as more functions are called?
Another thing I was wondering: Is it more efficient to have one frame listening to several events and decide what to do depending on the event within the one OnEvent function. Or to have several frames each listening to only one event? Or does this make no difference?