pykong / YubiGuard

Python script to prevent accidental triggering of YubiKeys on Linux.
GNU General Public License v3.0
24 stars 8 forks source link

intermittently very high CPU load on YubiGuard.py #13

Closed mozfreddyb closed 4 years ago

mozfreddyb commented 6 years ago

I sometimes observe very high CPU load on the python script, but have no way so far to debug or reproduce. I'll consider this issue an "early warning" and will fill in with more information as it becomes available.

@bfelder, can you give me any suggestions what I can do to turn this issue into something more actionable?

pykong commented 6 years ago

@mozfreddyb You are correct. Actually, it has to do with the constant polling of the xinput. You may reduce the cycle time to lessen CPU load. (I already did but for some machines, this may not be enough.)

Maybe there is a much better way to go about the whole program logic which does not task the CPU that much. But right now I do not know any better.

mozfreddyb commented 6 years ago

cycle time? This is the time.sleep(0.1) in line 168, I suppose?

pykong commented 6 years ago

Yes. Just use 1 as an argument and see how it affects the CPU load. Maybe you could make the value depending on settings, which would allow it to become more easily adjusted. Perhaps even by command line argument.

mozfreddyb commented 6 years ago

I'll give it a try, thanks!

pykong commented 4 years ago

Closing this in favour of a more actionable isssue: #14