-
Notifications
You must be signed in to change notification settings - Fork 19
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
1.8.1 has high cpu usage #75
Comments
Probably b/c AutoHDR is constantly polling for monitor changes ( Better would be to handle monitor changes as they occur. However, it's not entirely straightforward to get messages, as AutoHDR is mainly written using WPF... I looked around a bit, here's what I found, not sure to the extent that helps, or how to best fit it into AutoHDR's architecture: diff --git a/Source/AutoHDR/Views/AutoHDRMainView.xaml.cs b/Source/AutoHDR/Views/AutoHDRMainView.xaml.cs
index 30a057a..c060978 100644
--- a/Source/AutoHDR/Views/AutoHDRMainView.xaml.cs
+++ b/Source/AutoHDR/Views/AutoHDRMainView.xaml.cs
@@ -1,8 +1,10 @@
using AutoHDR.Properties;
using CodectoryCore.UI.Wpf;
+using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
+using System.Windows.Interop;
namespace AutoHDR.Views
{
@@ -27,8 +29,8 @@ namespace AutoHDR.Views
this.Hide();
}
-
+ private HwndSource hwndSource;
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
@@ -38,7 +40,23 @@ namespace AutoHDR.Views
Height = Properties.Settings.Default.Height;
}
- catch { }
+ catch { }
+
+ hwndSource = PresentationSource.FromVisual(this) as HwndSource;
+ hwndSource?.AddHook(WndProc);
}
- }
+
+ protected virtual IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
+ {
+ switch (msg)
+ {
+ case 0x007E: // WM_DISPLAYCHANGE
+ {
+ // Would update monitors here
+ break;
+ }
+ }
+ return IntPtr.Zero;
+ }
+ }
} |
me too, usage 5% on i7-12700K, 16GB, RTX3070, Windows11 |
Nvapi is the „problem“ here. Does the display changed event gets fired for
all cases (resolution, refresh rate, color depth)?
duk6046 ***@***.***> schrieb am Mi. 22. Dez. 2021 um 04:13:
… me too, usage 5% on i7-12700k
—
Reply to this email directly, view it on GitHub
<#75 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOWXFIMMF3K2REKJTQIJHXDUSE657ANCNFSM5KQFKU7Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I just run it, not use any functions |
Looks like it. I tried changing resolution and refresh rate using the "Display settings" and the message was triggered. Color depth is a bit more problematic since Windows doesn't offer a (user-facing) way to change the display BPP to anything other than 32bpp. Last but not least, plugging in (or unplugging) a monitor triggers the message, as does changing between mirroring and extending. I checked all that using a small test app: https://github.com/res2k/DisplayChangeTest - it prints something to the console when the message is received. |
me too high usage ( basically 7% ) in 5600x . and memory leaked to 91% (my 16gb ddr4) |
[New] - Audio actions are back, using code from AudioSwitcher (https://github.com/xenolightning/AudioSwitcher) [Bug fixes} - Nvapi causes high cpu usage ( 1.8.1 has high cpu usage #75) - Refresh rate changing not working for some users (v1.8.1+: Refresh rate switching is broken again #74)
Fixed in 1.8.2 |
[New] - Audio actions are back, using code from AudioSwitcher (https://github.com/xenolightning/AudioSwitcher) [Bug fixes} - Nvapi causes high cpu usage ( 1.8.1 has high cpu usage Codectory#75) - Refresh rate changing not working for some users (v1.8.1+: Refresh rate switching is broken again Codectory#74)
Describe the bug
1.8.1 has high cpu usage reported in W10 task manager and Hwinfo which create latency in games. Rolling back to 1.7.19 fixes the issue.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
normal (under 1%)
Files
Add logfile, UserSettings.json and, if applicable, screenshots to help explain your problem.
Desktop (please complete the following information):
Hardware (please complete the following information):
-Monitors: Samsung QN90A
-Graphics card: Strix 3080
-Graphics card driver: 471.96
-CPU: 10700K l(5Ghz all core)
The text was updated successfully, but these errors were encountered: