Bug 433048 - Plasma initial startup takes 30-50 seconds when autostarting apps (with and without KSplash)
Summary: Plasma initial startup takes 30-50 seconds when autostarting apps (with and w...
Status: REOPENED
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-performance (show other bugs)
Version: 5.24.90
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-17 07:39 UTC by Samuel
Modified: 2022-07-04 09:46 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
systemd-bootchart svg output. (605.14 KB, image/svg+xml)
2021-02-17 07:39 UTC, Samuel
Details
The output from GDB (955.04 KB, image/jpeg)
2021-05-18 12:22 UTC, Samuel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel 2021-02-17 07:39:05 UTC
Created attachment 135752 [details]
systemd-bootchart svg output.

SUMMARY
KDE initial startup takes 30-50 seconds when autostarting apps like Steam, Discord, KMail and GWE (with and without KSplash)

STEPS TO REPRODUCE
1. Start your computer
2. Enter user password in Display Manager and log-in to a Plasma session (X11 or Wayland)
3. Sit and watch your beautiful splash screen (disabling Splash screen doesnt make difference) load for 30 - 50 seconds or even more when Plasma gets updated.

OBSERVED RESULT
 Whenever I boot into my Plasma Desktop, the splash screen just sits on my screen loading for 30-50 seconds. Disabling Splash Screen from settings doesnt make difference. Even though the Wallpaper loads quickly the plasmoids and panels still take same amount of time to load.

 I autostart Steam (with "-silent" argument), Discord (with "--start-minimized" argument), KMail with start minimized to systray option and GreenWithEnvy minimized. When I remove steam and Discord from autostart list, I get palsma to load under 30 seconds (around 15-25 seconds) but its still a huge amount of time to wait.

 GNOME for example loads the GNOME Shell first within 5-7 seconds and then autostarts the apps. Can we get the same functionality with Plasma? 

EXPECTED RESULT
 Load Plasma shell within 5-7 seconds like GNOME does (for me atleast) and then autostart apps. Autostart apps should not make a difference in Plasma load time.

SOFTWARE/OS VERSIONS

Linux: Arch Linux / Linux-Zen 5.10.16
KDE Plasma Version: KDE Plasma 5.20.90 => I had this happen ever since I started using Plasma (since 5.18)
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
 I have also attached the systemd-bootchart (though it shows only 20 seconds) svg output. Systemd Bootchart was compiled from David Edmundson's repo.
Comment 1 Samuel 2021-02-17 07:41:46 UTC
I also have a NVIDIA GTX 1060 6GB with NVIDIA Proprietary Driver 460.39.
Comment 2 David Edmundson 2021-02-17 10:18:32 UTC
>Systemd Bootchart was compiled from David Edmundson's repo.

Appreciated, it helps a lot.

ksplashqml is the splash. It shows it closes after 7.2s. That's when we think we're up. It also means plasma has reported that it has loaded everything.

Can you expand a bit on what you're seeing on the screen during this 50s.
A wallpaper with no panels visible at all? Then later they magically arrive?

Does it also happen if you run plasmashell --replace?
Comment 3 Samuel 2021-02-17 13:39:49 UTC
(In reply to David Edmundson from comment #2)
> >Systemd Bootchart was compiled from David Edmundson's repo.
> 
> Appreciated, it helps a lot.
> 
> ksplashqml is the splash. It shows it closes after 7.2s. That's when we
> think we're up. It also means plasma has reported that it has loaded
> everything.
> 
> Can you expand a bit on what you're seeing on the screen during this 50s.
> A wallpaper with no panels visible at all? Then later they magically arrive?
> 
> Does it also happen if you run plasmashell --replace?

I just see the splash screen for the whole of 30 seconds and sometimes even upto 45 seconds
Comment 4 Samuel 2021-02-17 13:57:38 UTC
Here is the splash screen that I recorded just now : https://www.youtube.com/watch?v=QwfDq5v1Kc4 . Here it took 36.16 seconds to load (with steam, discord, KMail and GWE autostart, without which it takes 15-20 seconds to load). Also notice that when the splash screen exits, I get a black screen and then everything pops up.
Comment 5 Samuel 2021-02-17 14:01:55 UTC
(In reply to David Edmundson from comment #2)

> Does it also happen if you run plasmashell --replace?

No. It occurs instantly, like within 3 seconds.
Comment 6 Bug Janitor Service 2021-03-04 04:33:20 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Samuel 2021-03-17 15:24:45 UTC
This thing still happens for me in Plasma 5.21.3 :( While I was using plasma 5.21.0, When I turned off Splash screen, I would see my desktop within 10 seconds but whenever I turn on splash screen from System Settings (any splash, doesnt matter) it would load for 30 seconds. But now no matter I turn on or off the splash screen or not, I am getting 30 seconds load since 5.21.1.
Comment 8 Marc Oliver König 2021-05-13 17:37:51 UTC
I can confirm this bug. I have the same problem. Without any autostarting apps.
Comment 9 Samuel 2021-05-14 04:45:32 UTC
This is still present in Plasma 5.21.90. But now the whole shell loads up instead of splash screen quitting into a black screen and then loading up the shell (like seen in the video from Comment 4). I have ForceCompositionPipeline enabled (not the ForceFullCompositionPipeline one) and disabled "Sync to VBlank" and "Allow Flipping" in NVIDIA Control Panel.
Comment 10 Marc Oliver König 2021-05-18 09:48:51 UTC
With a update of systemd the bug is gone by me.
Comment 11 Samuel 2021-05-18 09:53:05 UTC
(In reply to Marc Oliver König from comment #10)
> With a update of systemd the bug is gone by me.

Since when were you having this bug? I was having the issue ever since I started using Plasma (5.18 or 5.19 I guess). Also am I supposed to turn on systemd startup from settings or is it opt-out setting?
Comment 12 Marc Oliver König 2021-05-18 10:15:29 UTC
I have only activated this feature with 5.21. I did the whole thing via the Konsole. It's best to disable it once, update to 248.3-1 and then enable the feature again.
Comment 13 Samuel 2021-05-18 10:52:00 UTC
   Now that I enabled the systemd startup feature through commandline, I can say that plasma loads up in 9-12 seconds. Huge improvement from 30 seconds. But without systemd startup, kde startup still takes 30 saeconds. So its still a bug. BTW thanks Marc for helping me solve this issue. But its not completely solved unless plasma startup takes similar time to start without systemd.
   Also is this feature going to be mentioned in System Settings? I had to hunt online to search the command to enable it.
Comment 14 Marc Oliver König 2021-05-18 10:58:51 UTC
(In reply to sampingu02 from comment #13)
>    Now that I enabled the systemd startup feature through commandline, I can
> say that plasma loads up in 9-12 seconds. Huge improvement from 30 seconds.
> But without systemd startup, kde startup still takes 30 saeconds. So its
> still a bug. BTW thanks Marc for helping me solve this issue. But its not
> completely solved unless plasma startup takes similar time to start without
> systemd.
>    Also is this feature going to be mentioned in System Settings? I had to
> hunt online to search the command to enable it.

I think it will take time to get it into the system settings. I have also use the command from the Terminal: "kwriteconfig5 --file startkderc --group General --key systemdBoot true"
Comment 15 David Edmundson 2021-05-18 11:03:56 UTC
>   Also is this feature going to be mentioned in System Settings

It will not. It will stay off by default until all bugs are fixed, then it will be on by default. 

As for your specific issue:

>with steam, discord, KMail and GWE autostart, without which it takes 15-20 seconds to load)

The common cause is that one of those applications in the .desktop file has 
"StartupNotify=true" 

and then fails to actually notify us it has started. In that situation we will sit there waiting until a timeout is eventually hit.


But that doesn't explain plasmashell not having any panels.

Can you attach the log file at ~/.local/share/sddm/xsession-errors (from a time when the delay happened)


Maybe you can quickly switch VT's after logging in and from a terminal type "sudo gdb --pid `pidof plasmashell`" then when it connects type "bt" and get a log of where it's stuck. 

The bootchart implies it's not completely dead, so I'm a bit surprised.
Comment 16 Samuel 2021-05-18 12:22:26 UTC
Created attachment 138534 [details]
The output from GDB

   I have nothing in ~/.local/share/sddm/ except "xorg-session.log" and "wayland-session.log". But I have disabled systemd startupand as expected, it took longer and I have switched to Vt as soon as I typed my password in SDDM and typed GDB the command. I did "bt" 3 or 4 times across 20 seconds and got the same output as seen in the attachment.
   Also when I switched to VT with plasma session in it, the plasma session was broken having only wallpaper, no panels and KWin compositing is disabled as it crashed.
Comment 17 David Edmundson 2021-06-28 17:22:05 UTC
Log shows plasma happily being busy loading data, which doesn't tell us a lot.
Comment 18 Samuel 2021-06-28 19:44:02 UTC
But I still get the long loads as shown in the video (but somewhat improved now as it doesn't land in a black screen and then load the shell) in Comment 4 with and without systemd startup (Systemd startup is somewhat better than normal startup or maybe its just a placebo idk). So is there anything that you need me to do?
Comment 19 Samuel 2021-10-23 09:31:23 UTC
I had my OS in SSD while my /home partition was in a HDD. It dies recently and I switched to a SSD for /home partition too and now plasma session opens within 10 seconds every time.
But the opening time with HDD was absurd. Maybe it was dying and hence opened so slowly? Anyway I am marking this issue as "resolved, not a bug".
Comment 20 Samuel 2021-10-23 09:33:46 UTC
But GNOME started within 10 sec on both my old HDD and this new SSD.
Comment 21 Bacteria 2021-10-23 09:48:19 UTC
I am still experiencing unusual delay when logging in on Wayland. It loads instantly on X11 but takes a good 10-15 seconds on Wayland. I have 4 startup apps.

One thing I have noticed is that I can actually interact with plasma while splash screen is showing. I have hot corner enabled for overview effect and that shows me application windows opened in the overview. Clicking on anyone takes me to the splash screen.
Comment 22 Bacteria 2021-10-23 09:48:59 UTC
(In reply to sampingu02 from comment #20)
> But GNOME started within 10 sec on both my old HDD and this new SSD.

Are you using Plasma with Wayland or X11?
Comment 23 Samuel 2021-10-24 20:01:58 UTC
(In reply to Bacteria from comment #22)
> Are you using Plasma with Wayland or X11?

X11 (NVIDIA)
Comment 24 Samuel 2021-10-24 20:02:41 UTC
(In reply to Bacteria from comment #21)
> I am still experiencing unusual delay when logging in on Wayland. It loads
> instantly on X11 but takes a good 10-15 seconds on Wayland. I have 4 startup
> apps.

I will reopen this bug report then....
Comment 25 Bacteria 2022-05-24 02:54:24 UTC
I am still able to reproduce this. When I have startup applications set, plasma takes 15-20 seconds to load. 

Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 5.24.90
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4
Graphics Platform: Wayland
Comment 26 Bacteria 2022-07-04 09:46:29 UTC
Looks like some applications can take a long time to startup and Plasma waits for the program to fully load. In my case, it was quaternion which is a matrix client. I removed it and the startup and now plasma shows up in 3-4 seconds after logging in.