Use caches from runtime if they exist #86

Merged
merged 4 commits into from Nov 29, 2017

Conversation

Projects
None yet
3 participants
Contributor

jhenstridge commented Nov 24, 2017

Currently desktop-launch builds caches for a number of things the first time a snapped app is run (gsettings schemas, mime database, icon theme caches, etc). Some of these operations are quite expensive, so it would be nice to avoid it if possible.

This branch makes a number of changes towards this goal:

  1. If a schema dir on $XDG_DATA_DIRS has a gschemas.compiled file, don't symlink its schemas to $XDG_DATA_HOME. Further more, if we don't symlink any schemas, don't run glib-compile-schemas.

  2. If a mime.cache file exists in the snap, don't copy the mime database or run update-mime-database.

  3. If an icon theme has an icon-theme.cache file, don't symlink it $XDG_DATA_HOME or run update-icon-caches.

Of these, (2) is the most noticeable. So that this actually does something, the gnome-3-26-1604 snap on edge channel has been updated to include these caches.

There are a few other changes in here too:

  1. stop adding non-existent directories to search path environment variables
  2. don't put $XDG_DATA_HOME on $XDG_DATA_DIRS: this is unnecessary.
Collaborator

kenvandine commented Nov 28, 2017

I've done some testing with this (combined with the font fixes branch) and saw significant improvements, at least with a snap that uses the gnome platform snap. I tested with gnome-characters and saw an improvement in startup time from 31s to 3s. Excellent results!

However I haven't tested this with the gtk3 launcher yet.

Contributor

oSoMoN commented Nov 29, 2017

This looks good to me. I've tested with the libreoffice snap, which doesn't use the gnome platform snap, but the gtk3 launcher. I have added a mime.cache file to the snap, and I verified that the launcher doesn't generate a new cache. Not seeing a significant improvement in terms of launch time the first time the app is used after installing it, but this may be due to libreoffice doing a lot more things at startup.

@kenvandine kenvandine merged commit 69c8af8 into Ubuntu:master Nov 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment