From 0d259d6d041da208094bb1f1c06d85b37706db67 Mon Sep 17 00:00:00 2001 From: alfrix Date: Sat, 19 Mar 2022 14:33:55 -0300 Subject: [PATCH] main_menu and temp: reduce load Drawing the graph has a high load impact, reduce the interval of redraw if the user needs instantaneous values, then the list provides it, the graph is there to provide historical data of behaviour not instantaneous values. -------- | Load | Note idle | 0.3 | screensaver menu | 0.4 | No process update extrude | 0.6 | updates temp graph 5s | 0.8 | graph 1s | 1.2 | the load is the 15 min mean after about half an hour Tests carried out on a Pi3A --- panels/main_menu.py | 3 ++- panels/temperature.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/panels/main_menu.py b/panels/main_menu.py index 9939ba26..a39a350e 100644 --- a/panels/main_menu.py +++ b/panels/main_menu.py @@ -48,7 +48,8 @@ class MainPanel(MenuPanel): def activate(self): if self.graph_update is None: - self.graph_update = GLib.timeout_add_seconds(1, self.update_graph) + # This has a high impact on load + self.graph_update = GLib.timeout_add_seconds(5, self.update_graph) return def deactivate(self): diff --git a/panels/temperature.py b/panels/temperature.py index f61191ab..f25d6b7a 100644 --- a/panels/temperature.py +++ b/panels/temperature.py @@ -184,7 +184,8 @@ class TemperaturePanel(ScreenPanel): def activate(self): if self.graph_update is None: - self.graph_update = GLib.timeout_add_seconds(1, self.update_graph) + # This has a high impact on load + self.graph_update = GLib.timeout_add_seconds(5, self.update_graph) def deactivate(self): if self.graph_update is not None: