Bug 491203

Summary: Cold start is slower than subsequent calls
Product: [Plasma] krunner Reporter: gudvinr+kde
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: alexander.lohnau, bugseforuns, natalie_clarius, nate, thepixelbozz
Priority: NOR    
Version First Reported In: 6.1.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description gudvinr+kde 2024-08-03 07:37:42 UTC
SUMMARY

First time you launch krunner, it happens with noticeable delay.
Subsequent launches do not have it.

One could say that "since it's only first time it doesn't matter". However,  since it is a tool for quick actions, it becomes very annoying because this is ruining workflow that you experience basically all other time you use krunner.

krunner probably need to do some startup work but clearly it is only done once.
If this work can be done asynchronously, it should be done asynchronously.
krunner window should be shown as soon as possible even if this work isn't done at the moment you see it.

It is very likely that background work will be already done when you finish typing query because while lag is there, it is not that long.

Even if it isn't easy to do this asynchronously with typing query in parallel, another option is to show krunner window and disable input and unlock when work done. In this case at least krunner feels responsive.

In case if lag caused by caching qml stuff or whatever it needs for rendering, plasma can do that stuff before first krunner launch.

STEPS TO REPRODUCE
1. Reboot
2. Press krunner shortcut

OBSERVED RESULT

krunner starts with delay

EXPECTED RESULT

No delay

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Kernel Version: 6.10.2-arch1-1 (64-bit)
Graphics Platform: X11
Comment 1 Nate Graham 2024-08-05 18:23:27 UTC
There are two ways we can improve this:
1. Pre-load or autostart it in the background
2. Speed up first launch

The problem with #1 is that it increase the background RAM usage on system boot, which some people (and YouTube reviewers...) are sensitive to.

The problem with #2 is that it's perpetually a moving target, and also doesn't seem to be that effective given KRunner's extreme responsiveness needs, frankly.

We might want to consider giving up and doing #1.
Comment 2 cwo 2024-08-10 15:07:23 UTC
*** Bug 491526 has been marked as a duplicate of this bug. ***