Bug 409599

Summary: Read appstream information in a thread for faster launch speed
Product: [Applications] Discover Reporter: Kai Uwe Broulik <kde>
Component: PackageKitAssignee: Dan Leinir Turthra Jensen <leinir>
Status: RESOLVED FIXED    
Severity: wishlist CC: aleixpol, nate
Priority: HI Keywords: usability
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.18.0
Sentry Crash Report:

Description Kai Uwe Broulik 2019-07-07 21:20:56 UTC
SUMMARY
Discover spends significant amount of time on opening in the appstream backend reading yaml files. The Flatpak backend does its metadata initialization in a thread and so should Appstream.
AppStream::Pool::load() accounts for 61% of time spent in discover's main thread until the main window appears.

STEPS TO REPRODUCE
1. Start Discover

OBSERVED RESULT
Takes forever to show a window, more than 5 seconds

EXPECTED RESULT
Shows a window within few hundred milliseconds

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.16.80
KDE Frameworks Version: 5.60
Qt Version: 5.12.3
Comment 1 Aleix Pol 2020-01-10 02:11:25 UTC
Git commit 2ce5eb9dab5b54d396f10fdde435a98181a7b2be by Aleix Pol.
Committed on 10/01/2020 at 02:11.
Pushed by apol into branch 'master'.

pk: Load the AppStream database on a separate thread

Summary:
No need to block the backends load on PackageKit appstream usage.
Related: bug 409262
FIXED-IN: 5.18.0

Test Plan: Tested manually

Reviewers: #discover_software_store, broulik, #plasma

Subscribers: ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26547

M  +138  -82   libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
M  +6    -0    libdiscover/backends/PackageKitBackend/PackageKitBackend.h

https://commits.kde.org/discover/2ce5eb9dab5b54d396f10fdde435a98181a7b2be