WoWInterface - View Single Post - Two addons showing high CPU usage, despite being small.
View Single Post
09-21-17, 04:55 PM   #5
A Pyroguard Emberseer
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,059
When you hook a script like GameTooltip:HookScript("OnUpdate"), its cpu usage is not measured correctly, it combines every other piece of code that's run along with the hooked function and counts that as the cpu used.

If you created your own frame to run the same OnUpdate script from, it would likely report a lower cpu usage.

That being said, this is not a very efficient function, and not something that needs to be run OnUpdate.

While I doubt this is using enough cpu to have an impact on your frame rate, the only time this code needs to run is you first mouse over a unit and when their target changes, so it could be moved into a function called by the OnTooltipSetUnit event, and a frame with RegisterUnitEvent('UNIT_TARGET', 'mouseover') on it.

First what you should do is just disable these 2 addons and see if it makes any difference in your frame rate, that will tell you if the problem is elsewhere.
  Reply With Quote