FillZpp / sys-info-rs

Get system information in Rust.
MIT License
168 stars 56 forks source link

Loop to find max CPU speed in Windows get_cpu_speed #82

Closed Alovchin91 closed 3 years ago

Alovchin91 commented 3 years ago

Great to see that sys-info now compiles correctly on Windows arm64! This would help a lot to make rustup for Windows arm64 happen: https://github.com/rust-lang/rustup/issues/2612

Funnily enough, a few days ago I have prepared exactly the same solution to make get_cpu_speed arm64-compatible on Windows but I was too slow to open a PR 😅

However, the solution currently in master gives me the wrong result when running cargo test -- --nocapture on my Surface Pro X: cpu_speed(): 1766.

The reason is ARM's big.LITTLE architecture when the "efficiency" cores are listed first. We need to loop through the CPU cores to find the "actual" maximum CPU speed. Doing this I get the expected result: cpu_speed(): 2995.

Alovchin91 commented 3 years ago

@FillZpp Hi! Could you please look into this? :) Thank you!