Showing results 1 to 5 of 5
Search took 0.00 seconds.
Search: Posts Made By: kurapica.igas
Forum: Lua/XML Help 08-28-13, 04:32 AM
Replies: 67
Views: 35,293
Posted By kurapica.igas
Thanks for the book. I also take back the word...

Thanks for the book.

I also take back the word 'The upvalue is the slowest', I'm confused about the result too, redo the test several times today, only 1 time the upvalue is slower than others, the...
Forum: Lua/XML Help 08-27-13, 08:30 PM
Replies: 67
Views: 35,293
Posted By kurapica.igas
Well, if you need a var in the OnUpdate or...

Well, if you need a var in the OnUpdate or something happened frequently, I suggest you may try the coroutine. Also a test example :

1. First part is using a local var 'sum' to contains the sum...
Forum: Lua/XML Help 08-26-13, 11:11 PM
Replies: 67
Views: 35,293
Posted By kurapica.igas
Oh, one more thing, about the memory usage, the...

Oh, one more thing, about the memory usage, the up-values cost much more if you use the local vars in many functions in your add-on, Here is a little test :


do
clear = function() collectgarbage()...
Forum: Lua/XML Help 08-26-13, 09:11 PM
Replies: 67
Views: 35,293
Posted By kurapica.igas
This is used to keep your variables not pollute...

This is used to keep your variables not pollute the _G, and gain some code flexibility.Also, the up-value is not as quick as you think.

Here is a test, a() function contains a long calculation, and...
Forum: Lua/XML Help 08-26-13, 03:57 AM
Replies: 67
Views: 35,293
Posted By kurapica.igas
If an addon has A.lua(at the top of the toc...

If an addon has A.lua(at the top of the toc file), B.lua

A.lua:

local addonName, addon = ...

if not getmetatable(addon) then
setmetatable(addon, {
__index = function(self, key)
...
Showing results 1 to 5 of 5