Bug 406384 - AppStream runner reduces KRunner performance and causes calculator runner to not show any results approximately 60% of the time
Summary: AppStream runner reduces KRunner performance and causes calculator runner to ...
Status: VERIFIED UPSTREAM
Alias: None
Product: krunner
Classification: Plasma
Component: calculator (show other bugs)
Version: 5.15.4
Platform: Other Linux
: HI major
Target Milestone: ---
Assignee: Kai Uwe Broulik
URL: https://github.com/ximion/appstream/i...
Keywords:
: 407994 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-04-10 00:40 UTC by Rakesh
Modified: 2019-06-17 15:39 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: AppStream 0.12.7


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rakesh 2019-04-10 00:40:49 UTC
I use Krunner multiple times a day for simple calculations and I have been noticing that it has been really hit or miss and it is really starting to hinder my productivity. About 60% of the time when I pull up Krunner and enter in something like 2+2, nothing comes up. Sometimes after I press the equals sign to "force" Krunner to do the calculation, the answer comes up, sometimes not. If I pre-pend equal sign, I get the same result, the calculator works sometimes and not all the time. Sometimes, I have to exit Krunner by pressing esc and invoke it again and run the query again. But, sometimes that doesn't even work.

STEPS TO REPRODUCE
1. Open Krunner
2. Enter in a calculation like 2+2
3. Check to see if the dropdown is displayed with the result

No dropdown is displayed below the search bar with the result.


Expected: Dropdown is displayed with the result of the calculation

Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2
Comment 1 Nate Graham 2019-04-10 04:38:53 UTC
I see this intermittently. Seems to trigger more frequently when I add parenthesees. For example "5+(5/6)" triggers no result until I add two equals signs (sometimes I have to them delete one or both).
Comment 2 Michael K. 2019-04-28 17:35:19 UTC
Same here. It's not just calculator but also bookmark and internet search.

Operating System: openSUSE Tumbleweed 20190425
KDE-Plasma-Version: 5.15.4
KDE-Frameworks-Version: 5.57.0
Qt-Version: 5.12.2
Kernel-Version: 5.0.9-1-default
Art des Betriebssystems: 64-bit
Processors: 4 × Intel® Core™ i5-6500T CPU @ 2.50GHz
Memory: 15,5 GiB Arbeitsspeicher
Comment 3 Kai Stian 2019-05-18 17:07:05 UTC
I also have this problem, but after disabling Software Center in Krunner it's working reliable again.
Comment 4 Nate Graham 2019-05-20 23:16:52 UTC
Wow, me too. That's a very useful observation, so thanks for that,
Comment 5 Nate Graham 2019-05-20 23:24:05 UTC
In fact turning that off makes KRunner way faster in general, in addition to fixing this bug. Clearly something needs to be fixed in the Software Center runner.
Comment 6 Nate Graham 2019-05-21 20:12:44 UTC
If this is a regression in the runner itself, there aren't a whole lot of commits that could have caused it: https://cgit.kde.org/plasma-workspace.git/log/runners/appstream/appstreamrunner.cpp

Maybe https://cgit.kde.org/plasma-workspace.git/commit/runners/appstream/appstreamrunner.cpp?id=0ec3f76810b712b99f18ef5f1afa70fe4a3884fd, need to check
Comment 7 Nate Graham 2019-05-21 20:59:37 UTC
Interestingly enough I can't reproduce this in KDE Neon Unstable (everything from git master). But I can reproduce it on Manjaro.
Comment 8 Nate Graham 2019-05-22 20:27:06 UTC
Investigation by Aleix Pol:

$ appstreamcli search "coco" | wc -l
6
$ appstreamcli search "2+2" | wc -l
8953
$ appstreamcli search "" | wc -l
8953

Looks like the culprit here is in the AppStream library which we use for returning matched apps for the AppStream runner when it's enabled. When there are no matches (e.g. because the search term was a mathematical expression), it seems to be returning all items instead of none, which is the cause of the slowdown.

Tracking this upstream: https://github.com/ximion/appstream/issues/237
Comment 9 Rakesh 2019-05-22 20:32:59 UTC
(In reply to Nate Graham from comment #8)
> Investigation by Aleix Pol:
> 
> $ appstreamcli search "coco" | wc -l
> 6
> $ appstreamcli search "2+2" | wc -l
> 8953
> $ appstreamcli search "" | wc -l
> 8953
> 
> Looks like the culprit here is in the AppStream library which we use for
> returning matched apps for the AppStream runner when it's enabled. When
> there are no matches (e.g. because the search term was a mathematical
> expression), it seems to be returning all items instead of none, which is
> the cause of the slowdown.
> 
> Tracking this upstream: https://github.com/ximion/appstream/issues/237

Fantastic, thank you for your hard work, Nate!
Comment 10 Nate Graham 2019-05-28 14:59:49 UTC
*** Bug 407994 has been marked as a duplicate of this bug. ***
Comment 11 Nate Graham 2019-06-17 00:25:39 UTC
Now fixed with https://github.com/ximion/appstream/commit/0d74990a3f119d1fd96703bd60996b0c43fae733 in AppStream 0.12.7
Comment 12 Patrick Silva 2019-06-17 15:03:50 UTC
I just updated to AppStream 0.12.7 on Arch Linux and I can confirm that this bug is fixed. \o/