-
-
Notifications
You must be signed in to change notification settings - Fork 678
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
CPU usage when idle #509
Comments
@kxt - this definitely looks like a good direction! I haven't tested this out yet, but how about you whip up a PR and we'll see how it behaves? Key things to check: performance when dumping lots of lines to the screen (eg. cat a 100000 lines file and time it). |
Thank you for your input! I'm going to create 2 PRs:
|
I've created the first PR with the refactor patches, #521. |
First PR merged! |
This patch fixes zellij-org#509 by using async read instead of polling a non-blocking fd. This reduces CPU usage when the ptys are idle.
This patch fixes zellij-org#509 by using async read instead of polling a non-blocking fd. This reduces CPU usage when the ptys are idle.
This patch fixes zellij-org#509 by using async read instead of polling a non-blocking fd. This reduces CPU usage when the ptys are idle.
This patch fixes zellij-org#509 by using async read instead of polling a non-blocking fd. This reduces CPU usage when the ptys are idle.
This patch fixes zellij-org#509 by using async read instead of polling a non-blocking fd. This reduces CPU usage when the ptys are idle.
This patch fixes zellij-org#509 by using async read instead of polling a non-blocking fd. This reduces CPU usage when the ptys are idle.
This patch fixes zellij-org#509 by using async read instead of polling a non-blocking fd. This reduces CPU usage when the ptys are idle.
This patch fixes #509 by using async read instead of polling a non-blocking fd. This reduces CPU usage when the ptys are idle.
version: 0.10.0
I've noticed that an idle zellij process (eg. running only a barebones shell) uses quite a lot of CPU and reduces battery life too. Having multiple panes/tabs makes this more severe.
I found that in
pty.rs
, each fd is being actively polled to check if new data is available from a client. This can be verified by running zellij with strace, it reports thousands of syscalls per second during steady state (ie. idle).I've created a proof-of-concept patch that uses async-std to manage io and timeout (for batching updates to reduce render time). With this patch, activity during idle drops significantly, the only activity reported by strace is
os_input_output.rs
'shandle_command_exit
looping.I need someone to review it and discuss whether an approach like this is suitable for zellij and if so, how to move forward (eg.
ServerOsApi
would need to become and async trait if an approach like this would be used).The text was updated successfully, but these errors were encountered: