Possible fps lags
ckaotik opened this issue ยท 4 comments
Hey,
it's me again, that person with annoying lag issues ;) I've noticed today that ABA might be part of my lag issue, too :(
To be explicit, what I noticed was an increase in used memory from 1MB at load to 2-3MB on bosses. This wouldn't be too worrying, except memory usage increases every couple of seconds by 100-200KB. The other thing is that after throwing in ResourceTools again (which of course messes up timings by its nature) it seems overlayPrototype:RegisterMessage and overlayPrototype:UnregisterMessage are called quite frequently and are rather slow. Couldn't something like this within overlayPrototype:UpdateDynamicUnits lighten the amount of function calls somewhat?
if listenMouseover and not self.listenMouseover then
self:RegisterMessage(MOUSEOVER_TICK, 'ScheduleUpdate')
self.listenMouseover = true
elseif self.listenMouseover then
self:UnregisterMessage(MOUSEOVER_TICK)
self.listenMouseover = false
end
What I also noticed is that whenever i mouseover a unit there are lots of calls caused by ActionButton_Update which probably relates to many of my macro'd spells with target=mouseover and mod conditions. This might explain why I encounter fps lag mainly on healer characters as I'm a hover-click/hover-cast healer (think Clique) and therefore hover units a lot.
Well, I am also healing with mouseover macros (hover + keyboard shortcuts) hence all the support code for macro targets.
About profiling, please note that, by definition, there always will be a first time-consuming function, and some function(s) with higher cost than others. Changing how the addon works could just make another function jumps to the top of the list, maybe with worst results. E.g. unregistering messages avoids to needlessly call the handlers, which could turn out to have a far higher cost than using RegisterMessage and UnregisterMessage.
Concerning the mouseover thing, the only alternative to using (Un)RegisterMessage would be to handle all the events and messages and return early when they are not needed. I am not sure it would be less time-consuming and I am sure it is more complex to handle (I would have to track which buttons depend on the mouseover unit).
However, I might give it a try if I found some time to rewrite the code. I'll take a look at the memory consumption, it may be related to table, however I am not sure why or how.
I find this really annoying to deal with - not because of you or your addons but because ... well, why is it causing trouble for me when it's doing fine on your (pretty much identical) system. Kind of frustrates me :/ I'm pretty close to just giving up and blaming the Mac version of the game for all this...
Anyways thanks for bearing with me!