GNOME Bugzilla – Bug 641414
Background applet takes too long to open when Pictures folder is huge
Last modified: 2011-02-11 19:07:08 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
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).
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.
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.