leng-yue / py-scrcpy-client

An easy to use python scrcpy client
https://leng-yue.github.io/py-scrcpy-client/
MIT License
290 stars 74 forks source link

Consistent CPU resource usage #3

Closed srevinsaju closed 3 years ago

srevinsaju commented 3 years ago

Hello! I noticed your comment on the issue on scrcpy. I work on guiscrcpy, which uses a python UI for scrcpy.

I wanted to integrate your project into mine, because yours is too cool! Thanks for this amazing UI.

One problem I noticed is that, your library uses a lot of cpu, compared to scrcpy. Scrcpy does use CPU only when the phone is not idle. But yours use CPU when the phone is idle too. Is there any optimization we can do?

image

leng-yue commented 3 years ago

Thanks for your interest, I will check what caused the consistent CPU usage.

leng-yue commented 3 years ago

This problem is caused by the infinite loop in the non-blocking IO.
It is solved now (by adding a 10ms sleep when no frame is received), and v0.3.3 is publishing.

srevinsaju commented 3 years ago

Thanks for the quick fix, much appreciate it.