Of course I know that locals are faster. If I didn't know that my plugins would be awfully slow But what you're using here isn't OOP. You're just getting a static function, putting it in a variable and calling. That won't work well with actuall methods. For example, look at the code I used for my test:
It's a really simple example of a class in Lua. What I could do is get the "Test" function and make it a local. Then give the object as a parameter, but how are you planning on making the TestVar variable a local? It's also of course not pretty to use that.
Code:
It's a really simple example of a class in Lua. What I could do is get the "Test" function and make it a local. Then give the object as a parameter, but how are you planning on making the TestVar variable a local? It's also of course not pretty to use that.