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

[BUG] High CPU Usage #183

Closed
Hamadah2O2 opened this issue Jul 15, 2024 · 11 comments
Closed

[BUG] High CPU Usage #183

Hamadah2O2 opened this issue Jul 15, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@Hamadah2O2
Copy link

Describe the bug 🐛
Maybe a duplicate of 177. same issue, and perhaps some reasons from me.
dooit seems always render the ui dirrectly, and causing high CPU usage.

To Reproduce 🐣
Steps to reproduce the behavior:

  1. Just install and dooit

Expected behavior 🤔
Low CPU usage on idle, or just render the ui on key pressed or mouse events .

Screenshots Video 🧐
I am using alacritty on high verbosity level:
DaVideo
(Sorry for low quality 😞)

On idle, textual seems stop rendering the ui, waiting for mouse events and then render the ui.
But dooit just always render and render and render the ui for live.

Desktop (please complete the following information): 🤖

  • OS: Linux

Additional context 📝
This is annoying while working on a project, but the CPU is being devoured by dooit!

@Hamadah2O2 Hamadah2O2 added the bug Something isn't working label Jul 15, 2024
@kraanzu
Copy link
Member

kraanzu commented Jul 15, 2024

Holy moly...that is very slow
Sorry for such an experience, this is really weird.

Yes dooit is trying to refresh a lot of widgets, its a poor design choice made by me and I'm fixing it right now

I don't think I'd be able to figure it out with this version, lets do this instead... I'll quicky try to replicate the minimal current user experience in a different branch and you can try that one out and see if this happens again? Might take a couple of days

Although I'm curious about the processor you're using, its launching very slow

@Hamadah2O2
Copy link
Author

Hamadah2O2 commented Jul 15, 2024

Holy moly...that is very slow Sorry for such an experience, this is really weird.
Although I'm curious about the processor you're using, its launching very slow

Don't worry, my processor runs at 1GHz, and do recording, causing it to launch veery slowly.
During normal startup (without recording), it only takes 1.5 seconds (fast enough i think) ... Kayak nya saya harus beli pc baru. 😭

Yes dooit is trying to refresh a lot of widgets, its a poor design choice made by me and I'm fixing it right now

I don't think I'd be able to figure it out with this version, lets do this instead... I'll quicky try to replicate the minimal current user experience in a different branch and you can try that one out and see if this happens again? Might take a couple of days

My plessure 🙌🏽

@kraanzu
Copy link
Member

kraanzu commented Jul 15, 2024

Kayak nya saya harus beli pc baru. 😭

hahaha...actually I previously had a slow laptop and then I bought a brand new PC when I got an internship. The funny thing is, I made dooit slower without even realizing because for me it'd launch quickly enough to barely notice any changes

Side note: If you liked dooit, you might also like this: https://github.com/kraanzu/smassh
plus, Can you see if this also has a high CPU usage problem?

@Hamadah2O2
Copy link
Author

Side note: If you liked dooit, you might also like this: https://github.com/kraanzu/smassh plus, Can you see if this also has a high CPU usage problem?

I like that too, I installed and used both dooit and smassh in the first time, which made me smash the keyboard every day.
And smassh seems does not have a high CPU usage, runs fine, and takes 0 CPU usage when idle.

The funny thing is, I made dooit slower without even realizing because for me it'd launch quickly enough to barely notice any changes.

hahaha, if it works don't touch it 😄

@kraanzu
Copy link
Member

kraanzu commented Jul 15, 2024

And smassh seems does not have a high CPU usage, runs fine, and takes 0 CPU usage when idle.

Ok super nice to hear that. Then its probably due to a lot of widgets
Fortunately, I'll be removing all of that and use only one widget for workspaces and todolists which also is very performant

@nguyentran0212
Copy link

I want to add that I also have high CPU usage with dooit. My machine is ThinkPad X1 Yoga Gen 4, running ArchLinux kernel 6.11.6-arch1-1. The CPU usage stays at 20% or more when dooit opens in a terminal. I tested Calcure and found that the CPU usage does not go beyond 5%, so it's likely not inefficiency of python.

Hope that you can find out a way to reduce the CPU usage. Dooit has the best user experience, like you really understand how a TUI todo list app should be controlled.

@kraanzu
Copy link
Member

kraanzu commented Nov 10, 2024

Hi @nguyentran0212!

Wow, it's been a long time since I updated the repo. Sorry about that. I released a newer version. Please check out the docs since it has changed a lot.

As for the high CPU, I tested it on Arch and NixOS and only saw a spike when I opened dooit, then it came back down

Arch: (This is running in docker)
image

NixOS:
image

Dooit has the best user experience, like you really understand how a TUI todo list app should be controlled.

Thanks a lot man. Much appreciated
If you liked the previous version, the newer version is 100x better, check out sample configs in the README

@nguyentran0212
Copy link

@kraanzu hey mate, I can confirm that the new version has fixed the high CPU usage problem. Thanks for updating the AUR version so that I don't have to install using pip. Great software.

@kraanzu
Copy link
Member

kraanzu commented Nov 10, 2024

Awesome!!! Thanks, and lemme know your thoughts on the newer version @nguyentran0212 !

@kraanzu
Copy link
Member

kraanzu commented Nov 10, 2024

I'll close this issue thread then :)

@kraanzu kraanzu closed this as completed Nov 10, 2024
Copy link

Did we solve your problem?
Glad we could help!

Consider sponsoring my work through github sponsors 😄
@kraanzu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants