View Single Post
01-07-13, 04:58 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by laukond View Post
Is there a way to rewrite the code so it does not update the FPS, ping, and memory all the time when hovering the TrackButton?
Yes, and I already told you how:

Originally Posted by Phanx View Post
If you're seeing your tooltip addon occupy increasing amounts of memory, it's probably because you're generating a new table on every update, which is very expensive and wasteful. You should only create the "topAddOns" table once, outside of the "UpdateTooltip" method. Since the number of table entries (NUM_ADDONS_TO_DISPLAY) never changes you don't even need to clear the table between uses; you can just overwrite the values like you're already doing.
The code SDPhantom posted includes a number of other improvements/optimizations, so you should probably just use that, but you could solve the specific problem you asked about by making the one specific change I suggested (moving the "topAddOns" table creation outside of the "UpdateTooltip" method).
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote