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 574121 - reduce gconf roundtrips at startup
reduce gconf roundtrips at startup
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2009-03-04 16:53 UTC by Matthias Clasen
Modified: 2010-01-21 21:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (5.47 KB, patch)
2009-03-04 16:54 UTC, Matthias Clasen
committed Details | Review

Description Matthias Clasen 2009-03-04 16:53:50 UTC
metacity tries to do the right thing, by preloading all the relevant directories before getting the keys one-by-one, but GConfClient isn't actually smart enough to avoid server roundtrips in this case. That should certainly be fixed in GConf.

In the meantime, here is a patch that reworks the metacity prefs initialization to avoid roundtrips for individual keys anyway, by using gconf_client_all_keys().
It also saves some lines:

prefs.c |  148 +++++++++++++++++++++++++++-------------------------------------
 1 file changed, 63 insertions(+), 85 deletions(-)
Comment 1 Matthias Clasen 2009-03-04 16:54:14 UTC
Created attachment 130037 [details] [review]
patch
Comment 2 Michael Meeks 2009-03-04 21:18:54 UTC
wow, is the recursive pre-load not working at all ? that's a tad sad - I guess we should look at that too; or is it that there are several overlapping recursive pre-loads there (?).

Patch looks lovely though.
Comment 3 Matthias Clasen 2009-03-04 23:07:00 UTC
The preload is working for the keys which _are_ in the database, like

/apps/metacity/global_keybindings/run_command_1

but not for all the _list keys which are not. 

GConfClient should be smart enough to notice that if it preloaded a directory and has a watch on it, it can trust negative results from the cache. 

Similarly, gconf_client_all_entries() should not go out and get everything from the server again, in this case.
Comment 4 Federico Mena Quintero 2009-03-05 18:29:37 UTC
(In reply to comment #3)
> 
> GConfClient should be smart enough to notice that if it preloaded a directory
> and has a watch on it, it can trust negative results from the cache. 

This patch for "negative caching" never got included/tested AFAIK:

http://mail.gnome.org/archives/performance-list/2007-April/msg00051.html

Or are we talking about different things? :)
Comment 5 Matthias Clasen 2009-03-05 19:25:28 UTC
No that pretty much covers what I mean. Thanks for saving me from reimplementing it !
Comment 6 Thomas Thurman 2010-01-21 21:54:39 UTC
Review of attachment 130037 [details] [review]:

Looks good and appears to work; committed.
Comment 7 Thomas Thurman 2010-01-21 21:54:58 UTC
FIXED.