[Lazarus] Lazarus GTK project dependencies

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Apr 14 11:36:10 CEST 2011


 
 

 michael.vancanneyt at wisa.be hat am 14. April 2011 um 10:17 geschrieben:

 >
 >
 > On Thu, 14 Apr 2011, Mattias Gaertner wrote:
 >
 > > On Thu, 14 Apr 2011 09:47:57 +0200 (CEST)
 > > michael.vancanneyt at wisa.be wrote:
 > >
 > >>
 > >>
 > >> On Thu, 14 Apr 2011, zeljko wrote:
 > >>
 > >>> On Thursday 14 of April 2011 09:33:03 Michael Van Canneyt wrote:
 > >>>> Hi,
 > >>>>
 > >>>> due to some other topic discussed on the mailing list, I thought I'd
 > >>>> check
 > >>>> the dependencies of a simple lazarus project. The result is shown below.
 > >>>>
 > >>>> I did this similar exercise a year or two ago, and the result has more
 > >>>> than
 > >>>> tripled !
 > >>>>
 > >>>> I wonder, why all these dependencies ??
 > >>>> I mean, libselinux, libcairo, libexpat, libdirectfb, libfusion,
 > >>>> libdirect
 > >>>> (to name but a few), why do I need those ?
 > >>>
 > >>> You don't but gtk does (or cairo or some xlib).
 > >>
 > >> Hm. I did a quick check:
 > >>
 > >> fsb: >ldd /usr/lib/libgdk-x11-2.0.so.0 | wc -l
 > >> 44
 > >> fsb: >ldd /usr/lib/libqt-mt.so.3.3.8 | wc -l
 > >> 31
 > >> So Qt needs 31 libs, GTK uses 44. Many of the extra ones related to direct
 > >> framebuffer
 > >> access, which is total nonsense in a X environment.
 > >
 > > The gnome projects likes to split libs in smaller modules.
 > > The number of libs is not that important. The size is more important:
 > >
 > > A gtk2 program:
 > > ldd testgtk2 | cut -d' ' -f 3 | grep lib | xargs cat | wc -c
 > > 14932491
 > >
 > > A qt program:
 > > ldd testqt | cut -d' ' -f 3 | grep lib | xargs cat | wc -c
 > > 53583219
 > >
 > > So Qt uses about 50MB, GTK uses 15MB.
 >
 > I get quite a different count:
 >
 > fsb: >ldd /usr/lib/libqt-mt.so.3.3.8 | cut -d' ' -f 3 | xargs cat | wc -c
 > 7172681 
The libqt-mt library is only one lib of a qt program.
 
 

 > fsb: >ldd /usr/lib/libgdk-x11-2.0.so.0 | cut -d' ' -f 3 | xargs cat | wc -c
 > 9804745 
And so is the libgdk of a gtk program. 
 

  
 > 7 vs. 9 Mb. Just for the Qt/Gtk library. 
Please compare whole programs. 
 

  
 > And that only size matters is not quite correct: for each library the number
 > of symbols in the libraries must be resolved.
 > The more libraries must be resolved, the more work there is for the linker. 
Since you gave no proof for this statement, I will answer with another
unproven: 
The bigger a library the more code, the more symbols must be resolved.  
 
I don't know how to test the library loading time, but here are some timings of
minimal gtk2/qt programs:
 
 time ./testgtk2

 real    0m0.035s
 user    0m0.028s
 sys     0m0.004s


 time ./testqt

 real    0m0.160s
 user    0m0.088s
 sys     0m0.032s


 

 >
 > That was the main issue in KDE: to reduce the number of symbols to be
 > resolved. This meant, less libraries.
 I doubt that combining several libs into one accelerates much.

 Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110414/d95409be/attachment-0003.html>


More information about the Lazarus mailing list