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

Wakeup reduction in EwmhDesktops #263

Merged
merged 5 commits into from
Feb 28, 2019

Conversation

bgamari
Copy link
Contributor

@bgamari bgamari commented Jun 19, 2018

Description

Previously the EwmhDesktops was painfully naive, sending property updates every time the log hook was invoked, even if none of the affected properties actually changed in value. This hurts significantly since it can cause a slew of unnecessary wakeups. Here we refactor the EWMH implementation to cache the current property value and only send updates if the value actually changes.

Previously xmonad was consistently sitting at 5% CPU usage when I was using my system (and taffybar even higher as it redraws its entire window when desktop names change). With this patch it sites at < 1%, exactly where it should be.

Fixes #227.

Checklist

@bgamari
Copy link
Contributor Author

bgamari commented Jun 19, 2018

Correct me if I'm wrong but I don't think the CI issue is due to my patch.

@colonelpanic8
Copy link
Contributor

@bgamari Ahh. Thanks for investigating this. I was wondering why CPU usage was so high. Thanks for doing the legwork to track this down.

@colonelpanic8
Copy link
Contributor

@bgamari I'm not convinced this is what is causing taffybar's high cpu usage.

As far as I can tell, taffybar only attempts interface updates when there is an actual change.

What led you to the conclusion that this was the cause?

@bgamari
Copy link
Contributor Author

bgamari commented Jun 25, 2018

@IvanMalison I observed a marked reduction in taffybar's CPU usage and wakeup count after applying this patch. Note that I still consider taffybar's CPU usage to be too high: I still see it saturate a good fraction of a CPU when switching desktops and a pretty minimal configuration still idles around 3%. However, this patch certainly helped and I'm afraid I don't have time to look farther at the moment.

@colonelpanic8
Copy link
Contributor

Note that I still consider taffybar's CPU usage to be too high: I still see it saturate a good fraction of a CPU when switching desktops and a pretty minimal configuration

Yes, I agree, this is likely due to the fact that taffybar simply redraws the entire workspace widget on any ewmh update. It shouldn't be too hard to have it avoiding redraws for window icons when nothing has changed.

minimal configuration still idles around 3%.

If I remove the clock and graph widgets i get 0% idle. I know you said that you don't have time to investigate, but could you try disabling those widgets and seeing if you see the same thing?

Continue discussion at taffybar/taffybar#385 to avoid spamming xmonad-contrib

@mgsloan
Copy link
Contributor

mgsloan commented Dec 29, 2018

LGTM 👍

@colonelpanic8
Copy link
Contributor

Is there a reason this hasn't been merged?

@byorgey byorgey merged commit ba9b108 into xmonad:master Feb 28, 2019
@byorgey
Copy link
Member

byorgey commented Feb 28, 2019

No reason, just not enough round tuits to go round, I guess...

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

Successfully merging this pull request may close these issues.

4 participants