-
Notifications
You must be signed in to change notification settings - Fork 38
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
Dbus-daemon: cpu usage #13
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I realised this if the delay in zscroll was increased, the spam goes slower. Maybe an issue with zscroll? |
I think I might have figured out why the issue is happening, but I haven't though of a good fix for it yet. You can simply test this yourself by using the Solution 1:One solution would be to make two delays: one for scrolling the text and another on for updating it (checking Solution 2:The better solution would be to find a way to make the spotify app or its dbus interface to "message" the script automatically when the song is updated so it doesn't have to check its status all the time, which would obviously be better than the first solution. I have no real idea of how to do this yet, however maybe somebody else does. Any feedback is greatly appreciated, |
@jan146 Thanks for taking such a deep dive into this problem. I never constantly monitor my idle CPU usage (and I should, thanks for the tip!) and never tried to measure the computation load of this module. I'm a student and so I wasn't able to get back quickly but let me take a look at what you're proposing. Solution 1 is obviously a naive way to deal with it. Keep us updated with what you come up with. And as far as solution 2 is concerned, I'm as lost as you are. I want to maintain the module in such a way that it works @brokenax3 Nice observation! I'll definitely keep that in mind. |
After doing some more testing, I found out that communicating with dbus directly resulted in much lower resource usage. Instead of using playerctl, I used the In a nutshell, the issue lays somewhere within I am using this solution (along with some other performance optimizations) in my own project. I originally planned on forking this one, since I made pretty much the same thing, however I do not require anything particular from this repo. I hope I have pointed you towards a possible solution, or at least narrowed down the problem, so it can be fixed sometime in the future. Thank you for your time. |
My CPU usage was going haywire with the Using the Thank you, @jan146 |
I did try a It has hardly any CPU usage. |
You guys might be surprised but its as easy as adding a simple interval in your polybar configuration for the module. This reduces the CPU usage very noticeably and I even created a PR for it here: #23 |
@DashCruft Thanks for the quick PR. If you got any numbers on how much of an improvement this change made, please feel free to post them here. |
After I implemented this module into my polybar configuration, I noticed that my idle cpu usage was slightly higher than usual. After disabling the module, I would get about ~10% lower cpu usage on average.
After looking a bit more into it, I found the processes that were the culprit:
Each one of them usually consumes ~5% of my cpu utilization (i5-8600k).
After looking up what these processes could be (before I realized it was this polybar module), I found out that they were spamming/flooding dbus messages (by running
sudo dbus-monitor --system
). The messages look something like this:Again, after disabling the spotify module, the messages don't appear anymore.
I belive I have properly edited both .sh files, but I will include them in the attachments just in case, along with the polybar module. Since GitHub doesn't support uploading .sh files, I will upload screenshots of the files instead.
Any help is greatly appreciated,
thanks in advance.
The text was updated successfully, but these errors were encountered: