Tyrrrz / LightBulb

Reduces eye strain by adjusting screen gamma based on the current time
MIT License
2.27k stars 141 forks source link

Why does LightBulb take so much CPU when in options? #197

Closed Antosser closed 2 years ago

Antosser commented 3 years ago

image

Tyrrrz commented 3 years ago

That looks pretty abnormal. Did it also start happening with the latest update for you?

Tyrrrz commented 3 years ago

Probably related to #198

Tyrrrz commented 3 years ago

@Antosser does this happen only when in settings?

Antosser commented 3 years ago

@Antosser does this happen only when in settings?

Antosser commented 3 years ago

That looks pretty abnormal. Did it also start happening with the latest update for you? I don't know. I've not been using LightBulb that long

wadbr commented 3 years ago

I'm getting 2/4% cpu usage constantly when app is in the tray and even disabled. Don't know if this is related. (Using latest portable version)

Tyrrrz commented 3 years ago

@wadbr probably unrelated. What's your CPU, just to have a point of reference for what 4% means?

wadbr commented 3 years ago

i5 4590 with an (oldish) amd gpu

I tried a couple older portable versions and it seems like the same thing exists 2.2.0, should I open a new issue?

Tyrrrz commented 3 years ago

It could be covered by #182 already. Some people have reported that their CPU usage is relatively high.

I'm using i5 4460 and, as of writing this, LightBulb uses 00 CPU according to Task Manager:

image

Same story for dotnet processes:

image

Note that this is when LightBulb is hidden to tray without the window opened. When the main window is opened it will use considerably more, as expected.

wadbr commented 3 years ago

Yes the problem I'm having is constant whether the window is open or not image Even when the app is disabled. It does seem CPU usage does not even change when I close the window or when I have it on image

I mean honestly it's not that big of a deal but it makes no sense, it should not do this.

Tyrrrz commented 3 years ago

Yeah :/ Unfortunately it's hard to diagnose this properly, apart from just profiling and improving performance in general, which is covered by #182 already.

Tyrrrz commented 2 years ago

I've come to realization that it's just the way Windows GUIs are. If you want to have some fun, try opening literally any application, track their CPU usage in Task Manager, and then move your mouse erratically on top of the application's window. CPU usage will spike significantly.

There are some separate performance challenges in the app even when it's hidden to tray (covered in #182), but they're most likely inherent to the framework the app is using unfortunately. I doubt I will have the mental capacity to find a solution to that, at least not without help. In any case, that's a separate issue, so I'll close this one based on the first paragraph.