Skip to content

Loop to find max CPU speed in Windows get_cpu_speed #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 25, 2021
Merged

Loop to find max CPU speed in Windows get_cpu_speed #82

merged 1 commit into from
Jan 25, 2021

Conversation

Alovchin91
Copy link
Contributor

@Alovchin91 Alovchin91 commented Jan 10, 2021

Great to see that sys-info now compiles correctly on Windows arm64! This would help a lot to make rustup for Windows arm64 happen: rust-lang/rustup#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
Copy link
Contributor Author

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

@FillZpp FillZpp merged commit cd21b5a into FillZpp:master Jan 25, 2021
@Alovchin91 Alovchin91 deleted the alovchin91/win-arm64-max-cpu-speed branch January 25, 2021 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants