Thread: Nameplates
View Single Post
07-30-12, 03:43 PM   #25
ballagarba
A Fallenroot Satyr
 
ballagarba's Avatar
Join Date: Mar 2009
Posts: 22
Originally Posted by zork View Post
@ballagarba
The two versions don't differ that much. Both use OnUpdate. (Even the animationgroup does).

The only big difference is that in the traditional way you iterate over all WorldFrame:GetChildren() all the time.

In the new version you check just one index that is either available or not.
I'm curious about how expensive WorldFrame:GetChildren() is. Assume: "local frames = select('#', WorldFrame:GetChildren())". Now you only have to do something if "frames" has changed from previous iteration, and you'd only have to iterate from the previous value of "frames" to its new one. So the cost of the function pretty much equals select('#', WorldFrame:GetChildren()).

Last edited by ballagarba : 07-30-12 at 03:49 PM.