cslarsen / wpm

Typeracer-like console app for measuring your WPM
GNU Affero General Public License v3.0
323 stars 48 forks source link

High cpu usage on idle #46

Closed BlackCapCoder closed 5 years ago

BlackCapCoder commented 5 years ago

Usually, wpm uses about 3% of my cpu just sitting in the background doing nothing. This is unfortunate, but perfectly acceptable.

However, this number seems to skyrocket for short texts! If wpm is run with wpm --short, then most of the texts causes it to use around 15%, which is more than I am willing to spend just leaving it in a terminal.

BlackCapCoder commented 5 years ago

Actually, this is unrelated to the length of the text; because there are fewer short texts the problem is just more likely to occur with wpm --short.

If you have typed a text before then your old score is written at the bottom on the screen, and this is what is causing cpu usage to go through the roof. In fact, if you begin typing on a problematic text then the problem goes away, because the old scores are no longer rendered.

cslarsen commented 5 years ago

Acknowledged. Should be easy to fix, but I'm not actively working on wpm currently. If you want to try your hand in creating a PR, I can take a look.

cslarsen commented 5 years ago

Fixed in 7176965827

This will be part of the next release. Thanks for reporting!