Skip to content

Asynchronous remote icon download

Georges Basile Stavracas Neto requested to merge gbsneto/icon-downloader into main

See commits. The motivation for this merge request is that, while profiling GNOME Software, downloading icons is by far the biggest offender to the fluidity of the app. That's because it blocks the refine operation, which is the operation performed while navigating through categories and whatnot.

This merge request introduces a new object made specifically for the purpose of asynchronously downloading remote icons. GsIconDownloader needs to live in the libgnome-software library because it needs access to private GsApp API; but it has to be public object because GsPluginIcon needs to create a single instance of it.

I think the current API is... okay. It doesn't spark joy in my heart, but I could at least convince myself that it's thread-safe and won't lead to corrupted icons under any circumstance.

With this patchset, loading categories is noticeably faster - my fingers could count 8~10 seconds of waiting for the "Development" category before these patches, and now it's ~2 seconds. That's because we now show the full list of apps before icons are downloaded, and keep downloading them on the fly.

Here's how it looks so far - notice the icons showing up on the fly:


Let's do a quick performance comparison:

Before After
before after

To be reviewed:

  • GsIconDownloader API and internal design - is it enough? Is it wrong?
  • The 3-dot icon 2. Needs Design
Edited by Georges Basile Stavracas Neto

Merge request reports