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.