Bug 455780

Summary: WindowHeap-based effects are slightly slower to activate than previous versions
Product: [Plasma] kwin Reporter: Phos <phyllon>
Component: effects-window-managementAssignee: KWin default assignee <kwin-bugs-null>
Status: CLOSED FIXED    
Severity: minor CC: al.neodim, bugseforuns, faf04348, fanzhuyifan, linx.system.adm, liubomirwm, makosol, nate, notmart, polardelphine, postix, tjkrobertson, unblended_icing552, vlad.zahorodnii, wbqq
Priority: HI Keywords: regression
Version: 6.1.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=459467
https://bugs.kde.org/show_bug.cgi?id=476002
Latest Commit: Version Fixed In: 6.0
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 490178    

Description Phos 2022-06-22 10:21:34 UTC
SUMMARY
The new QML effects like overview, present-windows, desktop grid are noticeably slower to activate.

STEPS TO REPRODUCE
1. Trigger present-windows

OBSERVED RESULT
The effect activates slower (there is a delay between pressing the button to the effect displaying.)

EXPECTED RESULT
The effect should trigger instantly

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.25.1
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5
Kernel Version: 5.18.5-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Comment 1 Nate Graham 2022-06-22 16:29:28 UTC
Can confirm.
Comment 2 Nate Graham 2022-09-08 19:58:52 UTC
It's become faster recently, but the small delay is still there.
Comment 3 Nate Graham 2022-09-22 17:22:09 UTC
*** Bug 459281 has been marked as a duplicate of this bug. ***
Comment 4 Nate Graham 2022-09-22 17:22:44 UTC
*** Bug 453221 has been marked as a duplicate of this bug. ***
Comment 5 Phos 2022-10-22 09:45:39 UTC
It seems to have gotten worse again in 5.26. The new animation curves are nice though. Still a very noticeable lag between pressing the button and the animation.
Another issue with 5.26 is that the animation never plays again when you activate the effects multiple times. For example, the Present Windows effect just doesn't play when you press the activation button multiple times.
Comment 6 Phos 2022-10-22 12:52:22 UTC
It takes the animation so long to activate that I have already released the key. Its pretty jarring how slow it is to activate.
Comment 7 Nate Graham 2022-12-05 20:00:20 UTC
*** Bug 462608 has been marked as a duplicate of this bug. ***
Comment 8 guimarcalsilva 2023-01-30 22:34:57 UTC
On a 6th gen i5 it takes around 4 seconds to activate the overview effect the first time, however, that only happens the first time. All subsequent activations work fine. I wonder if it would be possible to preload the active effects when the session starts.
Comment 9 Nate Graham 2023-02-07 20:08:24 UTC
*** Bug 465419 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2023-05-15 18:17:10 UTC
*** Bug 469446 has been marked as a duplicate of this bug. ***
Comment 11 Alex A.D. 2023-05-15 19:23:10 UTC
I wish devs deliver previous version of the present-windows but they responded on reddit that they won't. New present-effects version is a complete regression in terms of perfromance, usability and configurability.

If anyone is interested in compiling old version please let me know.
Comment 12 Lyubomir 2023-05-20 14:00:20 UTC Comment hidden (spam)
Comment 13 Lyubomir 2023-05-20 14:03:13 UTC Comment hidden (spam)
Comment 14 Nate Graham 2023-05-20 14:20:00 UTC Comment hidden (spam)
Comment 15 Alex A.D. 2023-05-21 19:58:20 UTC
(In reply to Lyubomir from comment #12)
> I think this also affects the Application Launcher. This is a very big issue, waiting for 1-3 seconds before it appearing...

I don't use Application Launcher so I can't confirm or disprove this. I use desktop grid and it works perfectly. Quite fast.
Comment 16 David Edmundson 2023-11-23 09:07:32 UTC
*** Bug 455585 has been marked as a duplicate of this bug. ***
Comment 17 Bug Janitor Service 2023-12-07 20:48:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4768
Comment 18 Vlad Zahorodnii 2023-12-08 10:31:03 UTC
Git commit f1ff706b3b1e769eaf67c4a5042e522edc286ab3 by Vlad Zahorodnii.
Committed on 08/12/2023 at 11:21.
Pushed by vladz into branch 'master'.

scripting: Cache WindowThumbnail textures

Effects like overview can create more than one thumbnail for the same
window. For example, if you have 4 virtual desktops, the overview is
going to create 9 window thumbnails for the desktop background, which in
its turn means that each thumbnail is going to have its own texture.
That's not great.

WindowThumbnailItem.sourceSize has been dropped because it's unused and
will complicate texture caching.

M  +156  -147  src/scripting/windowthumbnailitem.cpp
M  +37   -18   src/scripting/windowthumbnailitem.h

https://invent.kde.org/plasma/kwin/-/commit/f1ff706b3b1e769eaf67c4a5042e522edc286ab3
Comment 19 Vlad Zahorodnii 2023-12-08 13:48:58 UTC
Git commit eb13085de2173cb31dbb645725462d5cefadb213 by Vlad Zahorodnii.
Committed on 08/12/2023 at 14:40.
Pushed by vladz into branch 'master'.

plugins/overview: Load screen delegate asynchronously

The compilation step still takes a significant amount of time on the
first launch. On my machine, it's around 1s. Even if it happens just
once, freezing the session for 1 second is not great.

This change makes the overview effect load main.qml asynchronously
when plasma session starts. By the time the session is loaded, it should
be ready.

M  +4    -0    src/effect/quickeffect.cpp
M  +8    -1    src/plugins/overview/overvieweffect.cpp

https://invent.kde.org/plasma/kwin/-/commit/eb13085de2173cb31dbb645725462d5cefadb213
Comment 20 Vlad Zahorodnii 2023-12-12 15:31:00 UTC
Git commit ef2c4e201e2f062798068b728066630bf5ff85de by Vlad Zahorodnii.
Committed on 12/12/2023 at 16:21.
Pushed by vladz into branch 'master'.

plugins/overview: Load milou on demand

Milou.ResultsView loads runners regardless whether the query string is
empty. It's not clear what milou should do. There are valid arguments
both in favor and against preloading runners.

This change puts Milou.ResultsView behind a Loader so milou is loaded
when it's actually needed and not when starting overview.

M  +10   -5    src/plugins/overview/qml/main.qml

https://invent.kde.org/plasma/kwin/-/commit/ef2c4e201e2f062798068b728066630bf5ff85de
Comment 22 Nate Graham 2023-12-14 18:06:35 UTC
This is massively improved for me now; well within the range of the snappiness of the old C++ based effects for me, even when the system is under load. Let's call it fixed now!
Comment 23 polardelphine 2024-07-11 01:09:08 UTC
After a recent update, I can experience the same symptoms. Present windows is only activated with a very noticable delay. When you try to spam "meta+w" it is super laggy and easyly reproducable through that way.
Comment 24 Reiner Schmitts 2024-07-12 10:39:30 UTC
I have kwin version 6.1.2-1, and I can report the same Issue again. Task switcher and present windows are having some noticable amount of delay before they appear/function.
Comment 25 Nate Graham 2024-07-13 23:37:15 UTC
> After a recent update
This would suggest there was a regression unrelated to the original issue. Please open a new bug report for it.

> Task switcher
This is a different issue, likely Bug 479250.