The dashboard was constantly using around 15% CPU on my system while doing basically nothing. This drops usage to under 1% for all screens.
The high usage was caused by constantly re-drawing the screen in the main loop.
The implemented fix is to add a RefreshScreen event which is sent by sub-screens when data or key events occur that require a redraw.
In this way, redraws only occur when required.
I am not certain this is the best or most elegant way to fix it, but it seems to works well on my system.
Testing: I tested functionality in all screens and compared with a dashboard instance running the previous code, and they appear to function identically, including the send screen which has some tricky stuff grabbing user input and moving control focus.
The dashboard was constantly using around 15% CPU on my system while doing basically nothing. This drops usage to under 1% for all screens.
The high usage was caused by constantly re-drawing the screen in the main loop.
The implemented fix is to add a
RefreshScreen
event which is sent by sub-screens when data or key events occur that require a redraw.In this way, redraws only occur when required.
I am not certain this is the best or most elegant way to fix it, but it seems to works well on my system.
Testing: I tested functionality in all screens and compared with a dashboard instance running the previous code, and they appear to function identically, including the send screen which has some tricky stuff grabbing user input and moving control focus.