Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relatively high CPU usage while in the background doing nothing #310

Open
kotarac opened this issue Apr 8, 2021 · 0 comments
Open

relatively high CPU usage while in the background doing nothing #310

kotarac opened this issue Apr 8, 2021 · 0 comments

Comments

@kotarac
Copy link

kotarac commented Apr 8, 2021

Hey there!

I regularly profile addon CPU usage (for no particular reason) using https://www.curseforge.com/wow/addons/addon-usage.

I've noticed aux uses around 4-8 ms/s (milliseconds in a second) of CPU cycles while running in the background, no AH open, quite a bit after a fresh UI load.

Here's a screenshot of Addon Usage:
image

Quickly glancing at the code, I've noticed this is likely due to 2 unthrottled OnUpdate hooks in https://github.com/shirsig/aux-addon/blob/master/control.lua#L8 and https://github.com/shirsig/aux-addon/blob/master/control.lua#L55.
Doing a quick hack to throttle them to run at most once every 0.1s helped a lot and got it to consistently below 1 ms/s.

Now I imagine throttling like above would probably impact the performance of various addon operations (I've noticed these hooks coordinate listeners and coroutines).

What are your thoughts about this?
I'd be willing to get a PR up for throttling (perhaps configurable), if you think that's the right approach, and think this is an issue worth fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant