mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 16:00:39 +01:00
Overview of changes: - Adds field max_pp in frequency struct to hold the max freq for peak-performance estimation. - Instead of getting the max frequency in get_peak_performance, we get it in get_cpu_info (more natural). - Adds fill_frequency_info_pp which fills the max_pp of the passed cpu by calling measure_frequency. The approach is to call measure_frequency with a vector where the max frequencies are stored. Then, the first time measure_frequency is called, the frequency is measured while running all the cores, and the max frequency is computed per module (e.g., in the case of 2 modules, we would compute the freq for the first and for the second module), and saved into this vector. Subsequent calls to measure_frequency will just read the corresponding value for the vector. In other words, the frequency is only measured once for the whole CPU.