View Single Post
07-24-16, 09:19 AM   #4
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
Originally Posted by MuffinManKen View Post
I'm maintaining an addon that has table recycling, and if it really is a performance improvement then I'm okay with leaving it, but otherwise I prefer simple code.

What is the current state of this practice?
If my memory serves, early on in WoW, recycling was a must b/c the garbage collection in the Lua implementation was done at a threshold and usually caused a perceptible effect on the game. The implementation used now has incremental garbage collection so it has largely removed the need to constantly recycle tables. So if it's a very old addon, that may be the reason it recycles; if it's only a few years old, there might be a good reason it recycles.

However, w/o knowing the addon or the code or the logic behind it, it's impossible to say if it should be retained or not. There are still very good reasons to do it under certain circumstances.

So the generic answer is: if it isn't broke, don't fix it.
The generic answer if you want to do a bit if work is: do a version w/o it and then profile each.

Addons that use a lot of tables, esp large ones rebuilt for short durations, will tend to have some form of recycling but that most addons aren't complex enough to worry about it overmuch, but again it is very dependent on the addon.

Edit: I'm assuming Autobar is the addon. If so, I think it predates the incremental garbage collection so it'd recycle its tables. It's been years since I poked around trying to repair Autobar so I can't recall the kind of table usage it necessitates.
__________________
AddonsExecutive Assistant User Configurable To-Do ListLegible Mail Choose the Font for Your Mail

Last edited by VincentSDSH : 07-24-16 at 09:29 AM.
  Reply With Quote