After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 641414 - Background applet takes too long to open when Pictures folder is huge
Background applet takes too long to open when Pictures folder is huge
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Background
2.91.x
Other Linux
: Normal enhancement
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-02-03 23:14 UTC by ssldan
Modified: 2011-02-11 19:07 UTC
See Also:
GNOME target: 3.0
GNOME version: ---



Description ssldan 2011-02-03 23:14:31 UTC
It takes less than 3 sec to open background applet when "Pictures" folder is empty and about 10 sec when there is a collection of 500 images put into "Pictures" folder. This is on first time run. Every after, it opens relatively fast in both cases (less than 3 sec).

After I reboot machine and leave Pictures folder populated, first time run of background applet takes ~ 10 sec again.

This is with:
control-center-filesystem-2.91.6-1.fc15.x86_64
control-center-2.91.6-1.fc15.x86_64
Comment 1 Bastien Nocera 2011-02-03 23:16:12 UTC
As mentioned on IRC, the problem is with the directory loading which isn't asynchronous (so it takes this long to load the directory and enumerate the files, not to actually load the files).
Comment 2 Bastien Nocera 2011-02-09 17:47:51 UTC
It's actually calling gnome_bg_get_image_size() in gnome-wp-item.c (called from gnome_wp_item_new() and from a main thread function) which causes the problems.

If I disable that code, and don't get the image size, then I have (practically) no blocking on startup, and the application is only a tiny bit slow because it's loading and displaying 500 images.
Comment 3 Bastien Nocera 2011-02-11 19:07:08 UTC
commit 555bf47f5162c33fa26a5cf661ce680171e553f8
Author: Bastien Nocera <hadess@hadess.net>
Date:   Fri Feb 11 18:56:45 2011 +0000

    background: Load bg data when selected
    
    And only when selected. There's no point in loading it straight
    away, as we have more than enough metadata to display it in the
    icon view, and we'll need to load up the data when we display
    it anyway.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=641414

After the complete backend rewrite, this is now possible without sucking horribly. The application is still a tiny bit sluggish, but it doesn't hang quite as much.

The wallpaper loading will be next up to async'ise.