I've noticed there have been a number of messages about memory usage, but I've not yet found one about cpu usage. The reason I'm looking is because a bug in the addon I'm writing caused the game frame rate to drop dramatically. And this was without displaying anything on screen.
This got me thinking about how much my addon is using during "normal" operation. So my first question is; what information can I get to help me monitor my addon cpu usage?
Well, you could install Optionhouse (WowInterface) to monitor CPU usage and compare it against similar addons. This doesn't tell you WHY it uses too much CPU though, so i guess you should make an attachment with the lua file from your addon, so people can look over the code and give a few hints where needed.
Thanks for the suggestion of Optionhouse, I'll look that up.
I don't (yet) have an issue with normal cpu usage. It was only because of the bug that I started to think about it.
I'm guessing that if I have a problem it's because of loops. I also know that the OnUpdate is called frightenly frequently. As there is no point in my addon being active while in combat, I look for that and suspend all that I can.
OnUpdate is called on every frame. If you have 60 FPS, every addon's OnUpdate script is being called 60 times per second. That's why it's so important to throttle your OnUpdate, and do as little processing in your OnUpdate as possible, and only run your OnUpdate when you need it.
If you want any more specific suggestions on how you can optimize your code, post it.