View Single Post
08-20-14, 08:02 PM   #15
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Upvaluing a function indeed only saves you a global lookup. This is why I generally recommend against blindly upvaluing every global function you call in your addon, and only upvaluing the ones you're calling with extreme frequency, such as inside an OnUpdate script or CLEU handler. For more infrequent calls, the difference is hardly more than theoretical, so it's not worth the extra line of code to upvalue it.

Also, what's true in other Lua environments is not always true in the WoW Lua environment, as Blizzard has done a bit of customization. When in doubt, go benchmark it.
__________________
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