psifidotos / applet-window-buttons

Plasma 5 applet in order to show window buttons in your panels
GNU General Public License v2.0
404 stars 55 forks source link

Performance issues since Plasma 5.21 #123

Closed chrisnharvey closed 3 years ago

chrisnharvey commented 3 years ago

Since the upgrade to Plasma 5.21, I've been having performance issues with my panels (Latte Dock), particularly with animations. It also causes my panel to occasionally lock up for a few seconds.

I'm using the latest git version (commit: 16c66e9b70ad3fd19dede1dd73d1b9ad1c28183b)

I've tried disabling the compositor, adjusting Plasma's new latency option, trying Plasma Panels instead of Latte Dock, but the issue still remained.

I've started to delete applets from my panels one by one to see if one of them is causing this issue, and I think I've narrowed it down to this applet, as the issue only seems to appear when I re-add this applet to my panel.

See attached video of the issue:

https://user-images.githubusercontent.com/619298/111051708-24d1a780-844d-11eb-93d4-5477465121cb.mp4

psifidotos commented 3 years ago

sorry, it works fine in my plasma 5.21 system.

chrisnharvey commented 3 years ago

I don't think this is related to the window buttons applet after all. I think the issue is somewhere else, but since I was using the sliding animation with this applet, it made it worse.

Maybe my issue is something to do with animations in panels, not sure. Seems to only occur with panels, window animations aren't affected.

Been trying so hard to find where this bug is coming from, thought I'd found it when removing this applet fixed it for a while.

Thanks for your help @psifidotos, love the work you do with Latte Dock and these great applets!

gu1ll0me commented 3 years ago

Same problem here. I tried to pinpoint the problem like you for days (latency settings, plasma panel, latest Git Latte-Dock/window button/title/appmenu, Mesa 20.3/20.1). Some times after Latte-dock starts (maybe 10-15 minutes or after a certain time of use), each time I used the Kicker launcher or the clipboard applet, my CPU utilization goes to 100% for one core and the lock up happens for 1-2 seconds. Same thing happened if the Kicker launcher and the clipboard applet was on a plasma panel. It doesn't happen immediately after Latte-Dock starts but only after a couple of minutes or uses of the widgets. It seems that the more time the system is running, the worse the lock up is.

I ran Latte-Dock in debug mode yesterday and found that the lock up happened each time the action below was triggered:

[Debug : 8:25:39.999999] - "recreating buttons"

I also found that the Draw buttons inactive state when needed was causing the issue for me. Without this option, there is no more lock up with Kicker launcher or clipboard applet.

Show/hide Kicker menu + Show/hide clipboard with Draw buttons inactive state when needed enabled after some minutes: image

Same actions but with Draw buttons inactive state when needed disabled: image

My config: ArchLinux Plasma 5.21.3 Mesa 20.1 (AMD) Latest Latte-Dock/Window buttons commits with blur/shadows activated

Thank you.

psifidotos commented 3 years ago

hm that option "Draw buttons inactive state when needed" forces a reinitialization of buttons each time a window is active or not. That is a workaround for Breeze and Oxygen in order to work correctly... I think I will disable the workaround and any future bugs should be forwarded to relevant themes.

gu1ll0me commented 3 years ago

Thanks. I try the fix right now. I will post a feedback later to see if lock up are gone.

gu1ll0me commented 3 years ago

Unfortunately, the last commit didn't solved the CPU spikes. There is no more "recreating buttons" messages in the logs but the lockups still occurs.

psifidotos commented 3 years ago

What is your buttons theme?

gu1ll0me commented 3 years ago

Decoration: Current Colors: Plasma Theme

Plasma style: Breeze Dark

psifidotos commented 3 years ago

So which window decorations are you using in your system? Plasma systemsettings, appearance, window decorations

gu1ll0me commented 3 years ago

Breeze

psifidotos commented 3 years ago

sorry no more ideas. this is not reproducable in my system then.

gu1ll0me commented 3 years ago

I will try to do more tests eventually. Thanks.

gu1ll0me commented 3 years ago

All my settings, in case...

image

psifidotos commented 3 years ago

yep, I use the same in my system.

chrisnharvey commented 3 years ago

Thanks for your help @psifidotos

@gu1ll0me I feel your pain, this has been driving me crazy, but it happens for me even without using this applet, just not quite as badly.

I've reported a bug on KDE against task manager.

Out of interest, are you using the task manager applet too? Or any other applets?

I'm using:

I'd be interested to know if you're using any of those too, then maybe we could narrow it down to something else?

psifidotos commented 3 years ago

Lets take it from the beginning as you are two different users.

The cpu high usage in which process is it happening? plasmashell or latte?

chrisnharvey commented 3 years ago

For me it's latte that is causing the CPU usage to spike.

psifidotos commented 3 years ago

For me it's latte that is causing the CPU usage to spike.

Add a plasma panel and move your applets one by one from Latte to plasma panel until you find when plasmashell takes the cpu usage.

chrisnharvey commented 3 years ago

Just gave this a try and had some odd results.

I moved all applets to plasma panels, leaving a single empty latte panel with no applets on one monitor.

Everything seemed to work fine in plasma panels, but latte would still spike when changing active windows, even though there weren't any applets on the latte panel.

Now I've put everything back on my latte dock and it seems like every time the focused window changes, the latte CPU usage starts to increase over time (but only when changing focus, or moving to another monitor, which would trigger window buttons, appmenu, window title and task manager to change since I have these set to only show info from the current screen).

So latte peaks at 8% CPU usage when changing focus initially, then drops back to idle after a few seconds, then the more I change window focus, the spike for CPU usage starts to increase, until its maxed out a single core). It does always seem to drop back down to idle after a few seconds though).

It was difficult to pinpoint which applet specifically causes the problem, since it takes a while for the CPU usage to creep up.

chrisnharvey commented 3 years ago

I will give it a try with each applet individually, and use each one standalone for an hour each to see which one causes the CPU usage of latte to increase.

psifidotos commented 3 years ago

Your findings point to Latte core algorithm to track windows activeness, touching etc... Add a latte layout that contains only an empty panel with visibility mode Dodge Active. Do you have the same behavior with cpu?

psifidotos commented 3 years ago
  1. Are we talking about Latte git version or stable version?
chrisnharvey commented 3 years ago

Hmmmm, it doesn't seem to happen with a single panel with "Dodge Active" enabled.

I'm using the git version, but I've also tried with the version from the neon repos, and the same issue occurs.

psifidotos commented 3 years ago

Hmmmm, it doesn't seem to happen with a single panel with "Dodge Active" enabled.

I'm using the git version, but I've also tried with the version from the neon repos, and the same issue occurs.

in such case, you need to add each in question applet in the empty panel and check if it occurs again. Try for the empty panel to have ONLY ONE applet inside it that you are checking each time.

chrisnharvey commented 3 years ago

Thanks @psifidotos, I'll give this a try.

I've been running the same applets that I normally use today, but using Plasma Panels instead of Latte Dock, and the issue has gone.

So it looks like it is only an issue with Latte. I think the reason I thought it happened in panels too is because I setup the same widgets in panels, but kept latte running last time, which seems to lock up the system when the CPU spikes.

gu1ll0me commented 3 years ago

I don't think our problems are related so I started a new issue to track this specific problem.

izissise commented 3 years ago

I had this issue and opened a ticket on plasma bugtracker https://bugs.kde.org/show_bug.cgi?id=434051

Disabling Draw buttons inactive state when needed fixed it for me