-
-
Notifications
You must be signed in to change notification settings - Fork 222
Advanced Technical Info
Note
This page hosts various explanations from the developer, Hekili, of some of the more advanced workings of the addon.
The more icons that are displayed, the more time the addon spends generating recommendations to fill those icon slots. Conversely, if you want to save some CPU time, you can set your Primary and AOE displays to show fewer icons. If you are playing a specialization that involves a lot of RNG, you may find that only 1 or 2 icons are truly useful as your recommendations otherwise shift due to procs that cannot be anticipated in advance.
For each display that is shown, the addon conducts a "reset" before generating recommendations. This means that having displays shown separately is slightly more expensive than displaying all recommendations in your Primary and AOE displays. However, it is usually worth the tradeoff to go ahead and have Interrupts shown separately if that is how you prefer the addon to function.
In your specialization's settings, there is a Performance tab that includes some settings that can help you to reduce the addon's impact on your CPU.
I'm still tweaking it; there are a few variables to consider when (auto)tuning:
- Actual work time needed per update, with update defined as all recs for all displays being recalculated
- Necessary updates per second
- Your actual FPS
Actual work time is largely based on the complexity of your spec's priorities, but Syrif and I have been working to find where we can reduce that complexity (i.e., unnecessary variables, unnecessary priority splitting, etc.).
Necessary updates per second is challenging because there are lots of events that potentially change the game state such that recommendations could / should change. However, if the addon updates on every single event, it would be wasteful because you'd refresh due to (1) spending resources, (2) casting a spell, (3) consuming a buff when casting the spell, and (4) gaining buffs / applying debuffs. You don't want to update 4 times, but all of these 4 events can trigger in different orders and in different frames. My current strategy is to have a regular pulse for updates that passes naturally and then when events fire, they advance the pulse by some amount, making the update come sooner. You can see in Syrif's screenshot, that 2.67 updates per second is working well (so y'all that were doing 20 updates per second before were wilding). This still isn't perfect, and the regular pulse and time per event may become user options.
Your actual FPS may/may not be useful, I'm still deciding. Basically, any work that any addon does costs CPU time, so any time updates take 1000 / (your FPS), you are losing a frame. However, your FPS shifts based on all sorts of stuff (like in a raid, all your addons and the base UI are processing a lot more events and your FPS naturally drops). So there may be some balance to be found re: how the work is split per frame. However, the more frames you take to generate recommendations, the less responsive the addon will be/feel.
If you get 100 FPS, that's 10ms per frame without any addons.
Syrif's screenshot shows updates take, on average, 10.64
seconds of work over 2 frames. That means you get 10ms
* 2 for the regular frames + 10.64ms
= 30.64ms
for the addon to generate updates and update all your displays. (Technically, each display gets updated in processing, so some displays are done during the first frame). 10.64ms * 2 frames = 21.2ms
of frame time used for each update, and with 2.57 updates/sec
that means you get 54.5ms of work per second, which essentially costs 5 total frames (in combat). You go from 100 FPS to 95 FPS (although it's not "smooth" you get most frames at 10ms and a handful of frames delayed by ~5.3ms
).
So, the real way to improve efficiency is to simplify priorities or internal calculations so there's less work required to make recommendations. However, there's also a user experience difference related to splitting work across frames. If we didn't split the work across frames at all, you'd lose a whole frame 2.5 times per second and you'd likely experience that as a frame stutter which feels extremely bad. However, that means recommendations would show in the minimum amount of time (10ms
for the frame, 10.64ms
for the work = 20.64ms
). If you split that work across 10 frames, it now takes (10ms * 10 frames + 10.64ms
) 110.64ms for updates to occur and this starts to get perceptible to the user.
Throw in that other addons are working and generally cost more CPU in combat, your FPS is dropping and maybe you go from 100 FPS without Hekili to 80 FPS without Hekili just because of the CPU load of the base UI and your other addons. Your frames (on average) now take 1000 / 80 = 12.5ms
to update, and it's probably spiky where some frames are still taking 10ms
and other frames are taking 20ms
. If the addon happens to do work in the same frame as another addon, you get a larger spike of work which may end up being enough time to delay a frame or two and experience that stutter again.
So the addon has to come up with some balance of (1) reducing work needed to generate updates, (2) limiting the number of updates per second to try to only give relevant updates that would change recommendations, (3) your actual FPS not impacted by addons at all, to try to avoid causing spikes that you'll feel, and (4) dividing work across frames to avoid that same spikiness but without also taking too long to generate updates and feeling unresponsive.
Thank you for coming to my TED talk.