Re: GDBus in gio? [was Re: Minutes of the GTK+ Team Meeting - 2009-11-10]

On Fri, 2009-11-13 at 16:37 +0200, Andrew W. Nosenko wrote:
> On Fri, Nov 13, 2009 at 15:31, Alexander Larsson <alexl redhat com> wrote:
> > On Fri, 2009-11-13 at 01:31 +0200, Andrew W. Nosenko wrote:
> >> On Thu, Nov 12, 2009 at 20:52, Alexander Larsson <alexl redhat com> wrote:
> >> > On Tue, 2009-11-10 at 18:22 -0600, Stef Walter wrote:
> >> >> Emmanuele Bassi wrote:
> >> >> > 1. bug 600141 (desrt)
> >> >> > - dbus-1 brings in pthread
> >> >> > - gio-2.0 doesn't
> >> >> > - dlopen()-ing a shared object linking to pthread from a library
> >> >> >   that doesn't is a big no-no which kind of works in Linux but
> >> >> >   breaks things like gdb
> >> >> > - big hammer: make gio-2.0 depend on gthread-2.0
> >> >> > - small hammer: make gio-2.0 pkg-config file include -pthread
> >> >> > ACTION: desrt should involve gtk-devel-list and gather feedback
> >> >>
> >> >> Is there a reason the dbus stuff won't become its own glib module along
> >> >> side gio, gobject, gthread etc...?
> >> >
> >> > Well, gio would still need to link to this so all gio apps still pull it
> >> > in. Additionally there is a non-negligible overhead for each library
> >> > linked into an app (due to elf linking rules), so the extra library is a
> >> > performance loss for all applications.
> >>
> >> Excuse me, but it is unclear about what you said: pthread or dbus?
> >> I mean in the "Well, gio would still need to link to this so all gio
> >> apps still pull it in" sentence.
> >
> > I meant to refer to gdbus by "it" here.
> Then yet another question: why do you think that all applications,
> which linked with gio are need dbus and, therefore, would to be linked
> with it anyway?
> Simple example: one of my programs uses libsoup.  Uses it for ages.
> Just for HTTP server and, sometime, client.  Accordingly to your
> logic, my program needs dbus and would be linked with it anyway.  Just
> because since some version libsoup linked with libgio as dependency.
> But my program doesn't need dbus!  Moreover, I don't use even GIO directly!

Yes, not all applications that link to gio needs every feature of gio.
If you link to glib because you want to use GHashTable you get GRegexp
for free, even if you don't want to use it. This will always be the case
for libraries, unless we put one function in each library.

Similarly there are (will be) features in libgio that require dbus (such
as GVfs and a dconf based GSettings). Not all applications that use
libgio will use these features of course, and the dependancy is
redundant for those. However, the stuff we put in glib/gio are things
that we deem a majority, or at least a large subset of applications will
need (like settings and file i/o).

So, since there are features in gio that require dbus it will need to
pull in dbus, even if your app doesn't use that particular feature.
However, if nothing uses the dbus using functionallity then most of
libdbus will not have to be paged in. And anyway, since many apps use
these things they are likely to be in memory anyway. 

Of course, there is the runtime linker overhead of the extra linked in
library thats (in your case) not used, which is unfortunate. But this is
still better than putting the dbus functionallity in its own module as
then that overhead would be doubled (separate gdbus library + libdbus)
for all apps that use dbus.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]