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

Nix tree eats a core, even in idle #22

Closed
piegamesde opened this issue Apr 30, 2021 · 2 comments
Closed

Nix tree eats a core, even in idle #22

piegamesde opened this issue Apr 30, 2021 · 2 comments

Comments

@piegamesde
Copy link

I get constant ~10% CPU usage, even though the application is idling in background.

@utdemir
Copy link
Owner

utdemir commented May 1, 2021

That is interesting, thank you for the issue!

When you first open nix-tree, it starts to precalculate a bunch of things in the background; which takes a while (should be less than 10 seconds on realistic dependency graph). I expect high cpu usage (close to 100%) when it's doing that.

However, it was supposed to settle down after a while. I can also observe that approximately 10% of a single CPU stays busy. I'll try to figure out the reason.

@utdemir utdemir closed this as completed in e313e84 May 1, 2021
@utdemir
Copy link
Owner

utdemir commented May 1, 2021

It was an easy fix. nix-tree has a background thread which ticks periodically and those ticks end up redrawing the screen (this is because the application sometimes has to measure how much time has passed after changing the sort order). This was happening quite often, I made it 10 times less often and the idle CPU usage dropped significantly.

I won't cut a release just yet because it is a pretty minor fix, but you should be able to test it if you use the current main branch.

Thanks again!

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

2 participants