Originally Posted by cremor
I haven't seen the problem with the shown frames in Holy spec on login with the new version, but it still happens on reload UI.
Will do some performance test in the next days.
|
Sorry for the (very) late reply, but here are my performance tests (again just idling in Dalaran in Holy spec for 10 minutes):
(Yes, I switched from Broker_CPU to AddonProfiler, but I also checked Broker_CPU and it gives the same numbers.)
As you can see, the CPU time was even higher this time (900ms compared to 700ms in my previous test).
And I think I also know why:
Dalaran wasn't very crowded this time (still morning here), so I had higher frame rates (50-60 fps). And because your OnUpdate handler is called for each and every frame, a higher frame rate causes higher load.
You already have a timeSinceLastUpdate variable in that handler, so why not use it? Something like
if (self.timeSinceLastUpdate > some_number) then
would reduce the load fairly.
And while I'm looking on your OnUpdate handler, I really can't see it's purpose at all. You are doing a huge amount of checks and then just returning? What's the purpose of that? You only call DecideSpells() if the GetSpellInfo() call returns null, so when the player is not in Retribution spec. That doesn't make any sense, right?
So if I'm not completely wrong now, you can just kick the whole OnUpdate handler, because it does nothing (useful) right now.
And of course the other things I mentioned in my previous post (reworking and caching the whole check if the player is in Retribution spec, making tables local, ...) would also reduce the CPU load quite a bit.
Btw: Sorry if this post is a bit harsh, I really like your Addon and appreciate your work on it. I'd just like to see it a bit better coded
