Results 1 to 7 of 7

Thread: glib vs. no-glib

  1. #1
    Join Date
    Dec 2006
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default glib vs. no-glib

    Is there a performance advantage/disadvantage using Qt compiled with glib support? From the Trolltech docs:

    "To enable closer integration with the GNOME deskop environment and tools, Qt 4.2 now contains support for the Glib eventloop. This makes it possible for Qt applications to use plugins made using other Glib-based frameworks, and even enables Qt plugins to be created for use with non-Qt applications."

    I really don't care about closer integration with GNOME - I would like to develop pure Qt applications and would like a highly optimized Qt.

    Also, Glib has been ported natively to Windows (using mingw) and to Mac OS X as well. Is there a reason why Trolltech only decided to add glib support to X11/Unix versions?

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: glib vs. no-glib

    Regarding the porting of GLib - on Windows and OS X native event loops are used by Qt. The whole point of Qt and of the GLib integration is that Qt helps with portability. This means that Qt should be useful for developing for both KDE and Gnome - even if KDE is built using Qt.

  3. #3
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: glib vs. no-glib

    Anyone know why Qt now uses the Glib event loop by default? I turn it off when I build, but I wonder why the Trolls thought it was better than their own.

  4. #4
    Join Date
    Dec 2006
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: glib vs. no-glib

    Quote Originally Posted by e8johan View Post
    Regarding the porting of GLib - on Windows and OS X native event loops are used by Qt. The whole point of Qt and of the GLib integration is that Qt helps with portability. This means that Qt should be useful for developing for both KDE and Gnome - even if KDE is built using Qt.
    Most major GNOME/Gtk programs (Gimp, gaim, dia, gnumeric, abiword, etc.) have been ported natively to Windows and Mac OS X. I would think that including glib support on these platforms would give these developers the same advantages that the UNIX/X11 version now has.

    More info: http://www.qtnode.net/wiki/GLib_Event_Loop

    Glib is a pretty feature rich library with some nice data structures, threading support, and of course the event loop. But most (if not all) of this functionality is provided by Qt itself. And if Qt's implementation of the event loop is more performant, I'd rather disable glib support.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: glib vs. no-glib

    An article on QDevBlog can shed a little light on the subject.

  6. #6
    Join Date
    Dec 2006
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: glib vs. no-glib

    Quote Originally Posted by wysota View Post
    An article on QDevBlog can shed a little light on the subject.
    Yeah, I read that blog. Unfortunately, it doesn't cover performance. I've googled a bit, and haven't found anything. Since, it hasn't been brought up and people aren't really posting about performance increase/decrease, I'm assuming for now that it is a negligible change in performance. I find this strange, however, because one would think that using a new implementation of something as low level as the eventloop (which accounts for a large percentage of execution time) would definitely change performance one way or another.... The only performance factor I can come up with is the dynamic linker loading the additional libglib.{so,dylib,dll} (if it hasn't been loaded anyways) at program startup - this is of course negligible especially since glib is a relatively small library.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: glib vs. no-glib

    I think the performance change is not significant as both approaches surely try to optimise the thing. Glib is probably a bit slower as it has more features, but has more capabilities and probably proves to be better when multiple apps/libs use it. I don't know how the event loop in Glib works, is it shared between different apps or does every app have a separate instance of the loop?

Similar Threads

  1. Glib event loop
    By Brandybuck in forum Qt Programming
    Replies: 2
    Last Post: 28th September 2006, 17:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.