View Single Post
04-18-09, 02:01 AM   #38
Azul
Banned
 
Azul's Avatar
Join Date: Apr 2009
Posts: 19
Originally Posted by Pytlask View Post
No, not a specific 60 local variable limit, but they do usually have limits. With several functions using 60 variables, you can easily pass the maximum stack size in C .
Not limits anywhere near this low. And it's just one function, not several. And I've seen several addons give C stack overflow errors, and they didn't even use local variables at all!



Originally Posted by Pytlask View Post
Actually, Lua's implementation of the operations in the bit library are extremely efficient.
It being functions alone makes it outrageously more slow then it should be. Bitwise operations are supposed to be single opcodes, not dozens of branches and multiplications.




Originally Posted by Pytlask View Post
We hope to see the code, because that is where the problem is. You do not need 60 local variables in an OnUpdate function. If we can help you separate out the different operations into separate OnEvent functions, you will not have to worry about the 'inefficiency' of using tables to store options. (Lua tables are actually very efficient as well. You just have to be careful about leaving them around as garbage)
I don't see how having two OnUpdate functions with 30 variables each would be faster then a single OnUpdate function with 60. If anything it should be a lot slower.