kworkflow / patch-hub

patch-hub is a TUI that streamlines the interaction of Linux developers with patches archived on lore.kernel.org
GNU General Public License v2.0
8 stars 6 forks source link

fix: remove UI auto-refresh to solve high CPU usage #88

Closed davidbtadokoro closed 3 weeks ago

davidbtadokoro commented 3 weeks ago

Due to patch-hub refreshing the UI 60 times per second 1, some idle screens consume unreasonable CPU (like 10%, 20%, or even, 30%). At the moment, we don't even need to refresh the UI if there are no events to be processed. Currently we only process key events, but any kind of event works. In all trueness, we may never need to periodically refresh the UI, as patch-hub is purposed to be a lightweight TUI to streamline the work of Linux kernel maintainers and not a latest-gen game in which frames get stale basically instantaneously.

Given this context, remove any auto-refresh of the UI. The if block that effectively toggles the blocking and refreshing nature of the UI wasn't removed, only commented out in case we need to reintroduce this in the future.

Closes: #87