Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

CPU usage sum per-core percentages instead of average

Open lahwaacz opened this issue 5 years ago • 3 comments

The current way of showing CPU usage, which calculates the average load of all cores, assumes that all logical cores available to the system are "equal" regarding their contribution to the aggregate system load. This is not the case for CPUs with hyperthreading: if you have a laptop with a 4-core CPU, i.e. 8 virtual cores, it is reasonable and quite common to consider even 4-threaded computation as fully utilizing the CPU. But Waybar would show a usage of 50% which does not reflect the reality regarding attainable performance, drain power or most other metrics. Moreover, the more virtual cores there are on a system, the harder it is to spot situations where a sequential computation fully utilizes a single core.

These problems can be solved with an alternative way to present the overall CPU utilization. The "better" way is implemented e.g. in top which shows 4-core utilization by a single process as 400% etc. In Waybar it could be implemented as an optional alternative to {usage}. The implementation should be trivial - just sum the per-core usages.

lahwaacz avatar Mar 26 '19 22:03 lahwaacz