Hekili Priority Helper

Hekili Priority Helper

44M Downloads

Very high CPU usage for Balance Druid

TsunamiFM opened this issue ยท 7 comments

commented

Describe the Bug/Issue
Hekili CPU usage for Balance Druid is very high.

To Reproduce
Steps to reproduce the behavior:

  1. Play Balance Druid.
  2. Enable Hekili.
  3. Check CPU usage (for example using Addons Usage addon).

Expected behavior

  1. Hekili CPU usage not causing game to freeze during intense fights. In big raid groups and multiple enemies in combat (30 players, 20 enemies) Hekili sometimes causes UI freezes, cast delays and big DPS drop instead of DPS increase.
  2. Hekili CPU usage staying reasonable low in other situations, too (like near training dummies). Currently it's often like 60-90% CPU usage. It shouldn't be more than 20% even during intense fight, IMO.

Screenshots
CPU usage in safe area - training dummies in Heart of the Forest, when standing still:
image

and in combat near dummies:
image

Character data
https://pastebin.com/EXcuTuTA

Snapshot:

  1. When standing still: https://pastebin.com/YZZDwjns
  2. In combat near dummies: https://pastebin.com/ZnQ9e99N
  3. In combat near dummies, with CPU profiler disabled: https://pastebin.com/GPY3pyRE
  4. In real combat with raid group, CPU profiler disabled: https://pastebin.com/7gYXdh3p
commented

You can use any of the /hekili > Balance > Performance settings you'd like to manage CPU usage. Also keep in mind, more recommendations = more CPU usage.

The usage shown isn't "60-90%" of your CPU. It's 60-90% of your total addon CPU usage, in combat, where a lot of combat events are happening, which require a lot of updates.

commented

@Hekili You've said in issue #339 that you do optimizations for specs that are causing performance issues, and that people should deliver snapshots when it happens - so I did provide detailed report, to make analysis and optimizations easier. You've mentioned Fire Mage was optimized and performance improved a lot after that - Balance Druid is not on the list of supported classes?

commented

Of course Balance is supported. I explained where to look to reduce CPU usage. The addon uses more CPU in combat than other passive addons that are not crunching dozens of combat related details to make decisions and recommendations.

There are small optimizations that could be made for Balance, but nothing that will be wildly different in performance.

What other answer are you looking for?

commented

@Hekili Maybe review of both the algorithm and the implementation would be possible? Or looking at Lua Performance Tips and applying those to most time consuming functions (if it's not done, yet)?

Either way rule 1 should be that any game logic that might block the UI it should be always executed in strict time limit of max 16 milliseconds - to keep game UI at 60 fps. I like your addon a lot as rotation helper, but previous raid week without it was perfectly smooth. This week, when I switched from Resto to Balance and started using Hekili - UI started to freeze in intense raid fights, sometimes for like second or two (Quartz cast bar freezing, updated in extreme cases at rates like 1-3 fps, etc.). After disabling Hekili - game was smooth again.

Your addon is great in terms of functionality, but performance is major issue atm, IMO - at least for Balance Druid. I wouldn't mark this issue as closed, because problem is still there - default algorithm for Balance Druid can take like 50 or more milliseconds during the fight, each time it's invoked. And by default it's called 10 times a second, which may result in this addon eating like 50% or more of Lua processing power - that's pretty serious hit to the UI performance.

commented

Part of the challenge here is that you lack context that I have.

A snapshot taking 50ms is not indicative of regular performance -- the workload of pulling debug data for every expression and function multiple times and manipulating the string output is the vast majority of CPU time during a snapshot. I've tested this thoroughly -- if I have a snapshot run without actually collecting the debug data, runtime is reduced by 60 to 80%. Constructing a snapshot is exceptionally CPU intensive; a routine update is not.

By default it updates up to 10 times per second, if combat events require it. Generally, it's half that.

I promise you, I'm constantly exploring ways to improve CPU performance.

On your end, as a user, you can modify the performance settings to which I've referred you, if you're concerned. If you want to create a custom priority for yourself that prunes dead-ends in the action list based on your actual talents and covenants, you might squeeze out a few cycles as well.

That's really the extent of it.

commented

@Hekili I did what I could, that is cut down my queue back to 3 depth, and max 4 updates per seconds - but I still observed UI slowdowns with Hekili enabled in more intense fights.

As a developer I would probably try using dedicated Lua profiler, and/or added unit tests to measure performance of each spec APL in simulation of full raid environment (30 players + 15 enemies close to each other, like in Sire Denathrius phase 1, with Echoes of Sin), or maybe review the way how simc files are converted to the code. Just some random thoughts from an outsider not knowing this code - but maybe worth trying.

commented

Thanks for the feedback.