GNOME startup speed

I have been for a couple of days now looking at improving the startup speed of GNOME, and this is what I’ve found so far (patches not included).

  • gnome-session does a DNS check on the hostname, not sure why. I removed that and things seem to work as before.
  • Some programs in gnome-session are being started with g_spawn_sync. I changed some of them to be g_spawn_async.
  • esd is started twice, once in gnome-session and once in gnome-settings-daemon
  • Screensaver and typing break are not essential services for the startup, so I’ve changed gnome-settings-daemon to start those 2 processes on idle callbacks, so that they are started when everything else is running
  • xrdb is run 3 times in gnome-settings-daemon!

With these changes I’ve gone from starting the session in 12/15 seconds to 4/6 (I even got sometimes that ‘your session has lasted less than 10 seconds’ error after loging out immediately), and, I think, there is a lot of room for improvement still.

Not sending patches yet, since the changes I’ve made are quite ugly so far (commented out code, #ifdef’s, etc), but will be as soon as I get them sorted out.

Update: hadn’t really read Lorenzo’s analysis before, so I guess all the things he points out make much more room for improvement.

Also, bad news is that on the first login, things are quite slower (15/20 seconds), but I guess this could be easily improved by preloading libraries and programs.

4 Responses to “GNOME startup speed”

  1. bobdigi says:

    Keep up the good work Rodrigo, those seem like some fairly easy tweaks for some big gains. Thanks!

  2. Elijah says:

    Very cool work! Note, though, that Erwann already noticed the multiple xrdb calls in the d-d-l thread about possibly removing xrdb (see http://mail.gnome.org/archives/desktop-devel-list/2005-August/msg00300.html) and already filed a bug with a patch for this issue — http://bugzilla.gnome.org/show_bug.cgi?id=314774.

  3. Mike Hearn says:

    IIRC the reason for the first thing is that if your hostname doesn’t resolve Bonobo Activation causes massive delays. I think the check is there so the user is warned of this configuration error. I’d leave it ….

  4. Wayne Schuller says:

    the dns check is just awful.

    a couple of times installing a fresh ubuntu, I have wanted to begin my first desktop session whilst my networking config was only half finished.

    I got some strange dns error and gnome-session wouldn’t log into the desktop… quite frustrating.