FelixKratz / JankyBorders

A lightweight window border system for macOS
GNU General Public License v3.0
860 stars 19 forks source link

Intensive GPU usage with background blur #78

Open Bellavene opened 4 months ago

Bellavene commented 4 months ago

For some reason, I have non-stop GPU usage if I turn blur background on and a window is open. If the window is a fullscreen browser window, GPU usage goes crazy at full throttle. M1, macos 14.0

FelixKratz commented 4 months ago

I will have a look at this but ultimately, borders is not using the GPU itself. The WindowServer uses it for compositing the windows, should there really be excessive GPU usage for the blur feature, it probably needs to be removed.

What is your methodology for measuring the GPU usage?

Bellavene commented 4 months ago

Clearly something is wrong with the implementation. It shouldn't spam GPU like that.

I watch the usage through iStat Menus, it shows GPU load under the CPU usage menu. I've noticed the slow down only after a while, when I started an application depended on GPU, the frame rate was unusually low, unusable.

FelixKratz commented 4 months ago

The „implementation" is literally only one line: https://github.com/FelixKratz/JankyBorders/blob/db682e74b9190e95907f925039a8349aeb1d48b9/src/border.c#L290 So if anything goes wrong it is likely not in the borders code.

Apart from that I dont think your testing methodology is robust enough to draw conclusions. I will try to come up with something more sophisticated when I investigate this.

What I would advise is to disable the blur feature for now.

FelixKratz commented 4 months ago

So I removed the blur feature, as I was easily able to reproduce your findings (It is indeed GPU usage of WindowServer that gets out of hand, not the borders process). A more robust blur feature would likely need to be implemented using a CALayer backed solution.

OfficialCRUGG commented 2 months ago

Why fully remove it when it causes issues only for some people? I have barely any GPU usage change with this feature. It should receive a warning or be deprecated in any other way, but not removed until there's a better solution. Blur is, at least to me, an extremely important feature.

Bellavene commented 2 months ago

"Some people" I doubt it, it was eating GPU resources like crazy for no acceptable reason.

OfficialCRUGG commented 2 months ago

Well, it isn't for everyone. So even if it's only a few that can use it without issues, why take this very essential feature away from them, when you can just make it very clear that it can cause issues and no support is given for any issues or something like this.

Bellavene commented 2 months ago

It was for everyone, if you personally don't see an issue, doesn't mean it does not exist.

OfficialCRUGG commented 2 months ago

I can literally see my GPU usage... With blur on, it was at like 15% maximum. That's totally fine.

Bellavene commented 2 months ago

Even 15% non-stop for a static blur effect — is a huge issue. Needless to say, it was much more.

OfficialCRUGG commented 2 months ago

I think you are misunderstanding what I am saying. I'm not saying the difference was only 15% on your device, I am talking about mine. That's a literal fact. And I'm not saying this shouldn't be improved in the future, but fully taking it away even though many people have no issues with it. 15% GPU usage in no way limits my ability to use my device. If you have issues, why not just not use the feature until this is improved? I still don't see a reason for fully removing this, when adding a warning notice would have done the trick.

Bellavene commented 2 months ago

Where are those "many"? Stop this childish crying, please. You can simply install an older release and enjoy wasting your computing resources.

OfficialCRUGG commented 2 months ago

If everyone would face this issue, it would have been reported way earlier.

Once again, I don't think you're understanding me. I've literally just asked what speaks against leaving this in with a warning, when factually speaking, not everyone faces this issue. I don't intend to discuss about how many people have this or not.

Bellavene commented 2 months ago

You can simply install an older release and enjoy wasting your computing resources.

Read this sentence carefully

OfficialCRUGG commented 2 months ago

Why are you being toxic? I've asked a simple question. I would like to still be able to access future features and not be locked to a past build, that's a valid point. On my device, this effect doesn't waste a lot of resources, so I don't understand why this feature is being completely removed, when leaving it in and putting a warning somewhere would have done the trick.

Bellavene commented 2 months ago

No one is toxic with you, but you gave a reason already. Get in touch with reality. Take it in your hands, add your wasting blur by yourself, the code is here... So much crying over one line of code, please seek mental help.