View Single Post
01-18-13, 07:35 PM   #9
Barjack
A Black Drake
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 89
Originally Posted by Phanx View Post
Why are you running identical OnUpdate scripts on 20 frames, instead of running one OnUpdate script on one frame that updates all 20 frames? The default UI is not exactly a paragon of good programming, so whatever it's doing is largely irrelevant, because you shouldn't be using it as an example of how to do anything.
The savings of doing that are often negligible and can sometimes even be a performance loss when benchmarked due to table looping overhead. I only commented because I think your comment was absolutely ridiculous. But hey, let's go for another example. I have a total of five (wow, that's a lot) frames in my hypothetical UI, each of which track the duration of a debuff on my target or a buff on myself. I want the timers on them to be smooth and accurate, so I update the bars/timers on each of them four times per second (crazy, I know). Seems fine, right? But wait... five frames... updated four times per second... five times four... good lord, I'm calling the update function for these frames TWENTY TIMES A SECOND?! Something is clearly going horribly, horribly wrong here. What should I do, Phanx?
  Reply With Quote