Quantcast WoWInterface - View Single Post - Two addons showing high CPU usage, despite being small.
View Single Post
09-21-17, 03:34 AM   #2
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
The size of the code doesn't matter as far as CPU is concerned - what it's actually doing, and how often, does.

I'm not sure what you're doing in the second snippet, so I cannot really comment. In the first snippet, however, you are performing calculations whenever the GameTooltip updates in its OnUpdate script. The OnUpdate script fires every time your screen is updated, so if you are getting 120FPS in game your code is running that many times per second.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote