Thanks for all the advice and the links. Some concrete concerns I was wondering about, is the use of string indices for table lookups and string comparisons, but apparently they are not as computational expensive in LUA than I expected them to be.
To name one concrete example, I have a buff module that listens for the UNIT_AURA event and then iterates over all buffs of the respective unit to see wether certain ones are active. For each one found, the number of its occurances is counted (e.g. count the number of Renews, Rejuvenations, etc.) and for certain buffs other actions are taken. Implementing the behaviour like this
for i=1, MAX_BUFFS do
buff_name = UnitBuff( unit, i );
if( not buff_name ) then break; end
if( watched_buffs[ buff_name ] ) then
found_buffs[ buff_name ] = found_buffs[ buff_name ] + 1;
end
if( buff_name == BUFF1 ) then
elseif( buff_name == BUFF2 ) then
elseif( buff_name == BUFF3 ) then
end
end
apparently is efficient in LUA.
|