Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux, cpu_freq(): diminish os.stat() calls a bit
Micro optimization in reference to #1852 and #1851. Use glob.glob(), which internally relies on os.scandir() in order to list /sys/devices/system/cpu/cpufreq files. In doing so, we avoid os.path.exists() for each CPU, which internally uses os.stat(). Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
- Loading branch information