Bug 586276 - Don't spawn xrdb
Don't spawn xrdb
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: general
2.26.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2009-06-18 15:08 UTC by Ross Burton
Modified: 2010-03-15 16:19 UTC (History)
1 user (show)

See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample code (1.49 KB, text/x-csrc)
2009-06-18 15:08 UTC, Ross Burton
  Details
don't spawn xrdb in xsettings/font plugins (12.45 KB, patch)
2010-01-21 23:15 UTC, Martin Pitt
none Details | Diff | Review

Description Ross Burton 2009-06-18 15:08:26 UTC
gnome-settings-daemon currently spawns xrdb but that is pretty overkill when we're just setting a few properties, which is fairly simple to do directly (xrdb does a scary amount of string manipulation).

Attaching some prototype code which shows how to fetch the current X resources, set a property, and then set the resources.  This should be refactored as a utility function that the plugins can call.

Sadly I'm too busy at the moment to do this, so I'm marking this as gnome-love in case someone else fancies having a hack before I do.
Comment 1 Ross Burton 2009-06-18 15:08:51 UTC
Created attachment 136923 [details]
Sample code
Comment 2 Martin Pitt 2010-01-21 23:15:01 UTC
Created attachment 151974 [details] [review]
don't spawn xrdb in xsettings/font plugins

The .3 second delay of the entire session startup due to xrdb calling annoyed me as well (we are currently on a boot speed vendetta..).

This patch replaces xrdb calls in the xsettings and fonts plugins. I did not touch the xrdb plugin, since that's (1) harder to handle (due to the required merging) and (2) not enabled by default, and (3) soo 1980ish :)

I thoroughly tested it with both a nonexisting RESOURCE_MANAGER (xprop -remove) as well as overwriting existing keys. However, I didn't use your proposed StringDatabase approach, but instead just use the existing gstring_* methods (which is probably still faster, and easier to understand for me, too).

Please let me know what you think. I uploaded it to Ubuntu, and will report back if there are any problems.

Thanks!
Comment 3 Ross Burton 2010-01-22 10:35:51 UTC
Excellent.  I'll push this into Moblin for a bit of testing too.
Comment 4 Jens Granseuer 2010-01-27 19:51:27 UTC
If we can get a bit of positive feedback I'd like to still push this into 2.29.
Comment 5 Martin Pitt 2010-03-15 09:05:15 UTC
This patch has been in Ubuntu for about two months, without negative feedback so far. Is it still okay to push this into 2.29, or does it need to wait for .31?
Comment 6 Jens Granseuer 2010-03-15 15:59:03 UTC
Feel free to commit if you can do so before the release tonight. I won't be able to.
Comment 7 Martin Pitt 2010-03-15 16:19:22 UTC
(In reply to comment #6)
> Feel free to commit if you can do so before the release tonight. I won't be
> able to.

Thanks, pushed:

http://git.gnome.org/browse/gnome-settings-daemon/commit/?id=aa32ea50fc596100750988513004f7b86148388a

Note You need to log in before you can comment on or make changes to this bug.