• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

bin/H13-Mar-2021-1,284989

client/H03-May-2022-990447

common/H13-Mar-2021-1,705761

docs/H03-May-2022-622524

engine/H13-Mar-2021-2,8331,524

gdbus/H13-Mar-2021-840537

gsettings/H03-May-2022-301224

gvdb/H13-Mar-2021-1,580989

service/H13-Mar-2021-1,8601,274

shm/H13-Mar-2021-302140

tests/H13-Mar-2021-6,4944,548

COPYINGH A D13-Mar-202125.9 KiB511422

HACKINGH A D13-Mar-20212.8 KiB9258

NEWSH A D13-Mar-202125.6 KiB959694

READMEH A D13-Mar-20213.4 KiB7257

dconf.doapH A D13-Mar-20211.7 KiB5143

meson.buildH A D13-Mar-20212.8 KiB10482

meson_post_install.pyH A D13-Mar-2021191 106

trim-lcov.pyH A D13-Mar-20211.4 KiB5424

README

1dconf is a simple key/value storage system that is heavily optimised for
2reading.  This makes it an ideal system for storing user preferences
3(which are read 1000s of times for each time the user changes one).  It
4was created with this usecase in mind.
5
6All preferences are stored in a single large binary file.  Layering of
7preferences is possible using multiple files (ie: for site defaults).
8Lock-down is also supported.  The binary file for the defaults can
9optionally be compiled from a set of plain text keyfiles.
10
11dconf has a partial client/server architecture.  It uses D-Bus.  The
12server is only involved in writes (and is not activated in the user
13session until the user modifies a preference).  The service is
14stateless and can exit freely at any time (and is therefore robust
15against crashes).  The list of paths that each process is watching is
16stored within the D-Bus daemon itself (as D-Bus signal match rules).
17
18Reads are performed by direct access (via mmap) to the on-disk database
19which is essentially a hashtable.  For this reason, dconf reads
20typically involve zero system calls and are comparable to a hashtable
21lookup in terms of speed.  Practically speaking, in simple non-layered
22setups, dconf is less than 10 times slower than GHashTable.
23
24Writes are not optimised at all.  On some file systems, dconf-service
25will call fsync() for every write, which can introduce a latency of up
26to 100ms.  This latency is hidden by the client libraries through a
27clever "fast" mechanism that records the outstanding changes locally (so
28they can be read back immediately) until the service signals that a
29write has completed.
30
31dconf mostly targets Free Software operating systems.  It will
32theoretically run on Mac OS but there isn't much point to that (since
33Mac OS applications want to store preferences in plist files).  It is
34not possible to use dconf on Windows because of the inability to rename
35over a file that's still in use (which is what the dconf-service does on
36every write).
37
38The dconf API is not particularly friendly.  Because of this and the
39lack of portability, you almost certainly want to use some sort of
40wrapper API around it.  The wrapper API used by Gtk+ and GNOME
41applications is GSettings, which is included as part of GLib.  GSettings
42has backends for Windows (using the registry) and Mac OS (using property
43lists) as well as its dconf backend and is the proper API to use for
44graphical applications.
45
46dconf itself attempts to maintain a rather low profile with respect to
47dependencies.  For the most part, there is only a dependency on GLib.
48
49With the exception of the bin/ directory, dconf is written in C using
50libglib.  This is a very strong dependency due to the fact that dconf's
51type system is GVariant.
52
53The dconf-service has a dependency on libgio, as do the client libraries
54that make use of GDBus (and the utilities that make use of those
55libraries).
56
57The standard client library is libdconf (in client/).  If you can't use
58GSettings then you should probably want to use this next.
59
60There is also a libdbus-1 based library.  It does not depend on libgio,
61but still depends on libglib.  It is not recommended to use this library
62unless you have a legacy dependency on libdbus-1 (such as in Qt
63applications).
64
65Installing dconf follows the typical meson dance:
66
67  meson builddir
68  ninja -C builddir
69  ninja -C builddir install
70
71If you plan to contribute to dconf, please see the HACKING file.
72