diff --git a/services/SysStats.qml b/services/SysStats.qml index bbc5966..64c070c 100644 --- a/services/SysStats.qml +++ b/services/SysStats.qml @@ -52,6 +52,12 @@ Singleton { // poll interval in seconds readonly property int interval: 1 + // cpuFreq comes from /proc/cpuinfo, which the kernel regenerates in full on + // every read (cost grows with core count) — the priciest per-tick read here. + // Frequency on a status bar doesn't need 1 Hz precision, so only refresh it + // every Nth tick instead of on the CPU%/mem hot path. + readonly property int freqEveryTicks: 3 + // discovered sysfs paths (filled once by discover.sh) property string tempPath: "" property string batPath: "" @@ -271,15 +277,17 @@ Singleton { } function _tickOnce() { + const doFreq = root._tick % root.freqEveryTicks === 0; + statView.reload(); - cpuInfoView.reload(); + if (doFreq) cpuInfoView.reload(); memView.reload(); routeView.reload(); if (root.tempPath) tempView.reload(); if (root.batPath) { batCapView.reload(); batStatusView.reload(); } _parseCpu(); - _parseFreq(); + if (doFreq) _parseFreq(); _parseMem(); _parseTemp(); _parseBattery();