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

Heavy CPU usage while waiting for input in PowerShell #113

Closed
H0R5E opened this issue May 20, 2021 · 5 comments
Closed

Heavy CPU usage while waiting for input in PowerShell #113

H0R5E opened this issue May 20, 2021 · 5 comments
Assignees
Labels
upstream_issue This issue is caused by an upstream package wontfix This will not be worked on

Comments

@H0R5E
Copy link

H0R5E commented May 20, 2021

Hi,

I noticed that when python-inquirer is waiting for input it is using a lot of CPU (probably a whole CPU thread) while waiting for input. I took these screenshots below:

inquirer_wait

inquirer_cpu

The version I am running is:

inquirer 2.7.0 py_0 conda-forge

It's in a conda environment being run in PowerShell on Windows 10 Pro.

Is this expected behaviour? Is there anyway to make it less hungry?

Many thanks,

Mat

@Cube707
Copy link
Collaborator

Cube707 commented Jul 28, 2022

this comes from the underlying readchar libary which has a while: True loop in the windows implimentation. This is whats hogging all the CPU. (see magmax/python-readchar#42)

The new v4.0.0 fixes this but is only in pre-release right now. You can however test if it solves this issue if you want.

@H0R5E
Copy link
Author

H0R5E commented Jul 28, 2022

Sure, I'll give it a try.

@Cube707
Copy link
Collaborator

Cube707 commented Jul 28, 2022

than use this to update your readchar version:

pip install -U --pre readchar

@H0R5E
Copy link
Author

H0R5E commented Jul 28, 2022

low_cpu_usage

Solved! Looking forward to the full release.

@Cube707 Cube707 self-assigned this Aug 7, 2022
@Cube707 Cube707 added wontfix This will not be worked on upstream_issue This issue is caused by an upstream package labels Aug 7, 2022
@Cube707
Copy link
Collaborator

Cube707 commented Aug 12, 2022

closed with the latest readchar release

@Cube707 Cube707 closed this as completed Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream_issue This issue is caused by an upstream package wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants