Skip to content
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

[Bug] Pointless power plan change #2319

Open
levicki opened this issue Jun 5, 2023 · 3 comments · May be fixed by #2485
Open

[Bug] Pointless power plan change #2319

levicki opened this issue Jun 5, 2023 · 3 comments · May be fixed by #2485

Comments

@levicki
Copy link

levicki commented Jun 5, 2023

You should not change power plant to High Performance if it is already Ultimate Performance.

@adamsitnik
Copy link
Member

The bug must me somewhere here: https://github.com/dotnet/BenchmarkDotNet/blob/master/src/BenchmarkDotNet/Running/PowerManagementApplier.cs

Please send a PR with a fix

@levicki
Copy link
Author

levicki commented Jun 5, 2023

From the brief look at it I am not seeing the problem, must be in the calling code.

Another thing, what happens when user presses Ctrl+C to interrupt test execution? I don't see the code hooking console event handler to restore power plan when process is interrupted?

Absolutely the whole idea of messing with user settings is IMO bad if you don't guarantee they will be restored.

Another scenario -- Windows Update decides to restart the PC while the benchmark is running. Are you intercepting WM_QUERYENDSESSION to stop shutdown or at least restore power plan there?

@heron1
Copy link

heron1 commented Oct 17, 2023

Just had to come here and say as someone that just tried this framework the changing of power plans feels very weird. On my laptop I use balanced, yet when running these tests it changes the profile to performance, which increases my screen brightness (I have custom settings I'd like to retain between the different performance profiles). Is there a reason this is done, that performance profiling cannot be done on the user's current power plan?

@adamsitnik adamsitnik added this to the v0.13.x milestone Dec 11, 2023
MattFromRVA added a commit to MattFromRVA/BenchmarkDotNet that referenced this issue Dec 15, 2023
@MattFromRVA MattFromRVA linked a pull request Dec 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants