Quantcast WoWInterface - View Single Post - Filter Buffs/Debuffs on Default Nameplates
View Single Post
09-13-17, 04:44 AM   #2
CC_WOW
A Deviate Faerie Dragon
 
CC_WOW's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2016
Posts: 19
I'm not an expert by any means, but some basic profiling tells me that each time the Filter function is called you use an additional 700-800 bytes of memory (sometimes more) which are never freed (that part is the problem). This is probably the result of you re-creating tables every time the code is execute with the { ... } constructor - see http://lua-users.org/wiki/OptimisingGarbageCollection

Running collectgarbage("collect") would help, but it is obviously not a practical solution unless you do it at a given threshold only. Normally, the garbage collector would mark the unused table and should collect ("sweep") it automatically, but in my tests it simply hasn't done that and I couldn't tell you why - I assume it runs when too much memory has been used, which should still be long before you are getting FPS drops.

PS: Is overwriting APIs like that really a good idea? UnitAura is used by at least Blizzard_NamePlates and also in the BuffFrame (I think). But someone else surely is more proficient than I am in these things :P
  Reply With Quote