<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<title></title>
</head>
<body>
<p style="margin: 0px;"><span> </span></p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px 5px 0px;">
michael.vancanneyt@wisa.be hat am 14. April 2011 um 10:17 geschrieben:<br/>
<br/>
><br/>
><br/>
> On Thu, 14 Apr 2011, Mattias Gaertner wrote:<br/>
><br/>
> > On Thu, 14 Apr 2011 09:47:57 +0200 (CEST)<br/>
> > michael.vancanneyt@wisa.be wrote:<br/>
> ><br/>
> >><br/>
> >><br/>
> >> On Thu, 14 Apr 2011, zeljko wrote:<br/>
> >><br/>
> >>> On Thursday 14 of April 2011 09:33:03 Michael Van Canneyt wrote:<br/>
> >>>> Hi,<br/>
> >>>><br/>
> >>>> due to some other topic discussed on the mailing list, I thought I'd check<br/>
> >>>> the dependencies of a simple lazarus project. The result is shown below.<br/>
> >>>><br/>
> >>>> I did this similar exercise a year or two ago, and the result has more than<br/>
> >>>> tripled !<br/>
> >>>><br/>
> >>>> I wonder, why all these dependencies ??<br/>
> >>>> I mean, libselinux, libcairo, libexpat, libdirectfb, libfusion, libdirect<br/>
> >>>> (to name but a few), why do I need those ?<br/>
> >>><br/>
> >>> You don't but gtk does (or cairo or some xlib).<br/>
> >><br/>
> >> Hm. I did a quick check:<br/>
> >><br/>
> >> fsb: >ldd /usr/lib/libgdk-x11-2.0.so.0 | wc -l<br/>
> >> 44<br/>
> >> fsb: >ldd /usr/lib/libqt-mt.so.3.3.8 | wc -l<br/>
> >> 31<br/>
> >> So Qt needs 31 libs, GTK uses 44. Many of the extra ones related to direct framebuffer<br/>
> >> access, which is total nonsense in a X environment.<br/>
> ><br/>
> > The gnome projects likes to split libs in smaller modules.<br/>
> > The number of libs is not that important. The size is more important:<br/>
> ><br/>
> > A gtk2 program:<br/>
> > ldd testgtk2 | cut -d' ' -f 3 | grep lib | xargs cat | wc -c<br/>
> > 14932491<br/>
> ><br/>
> > A qt program:<br/>
> > ldd testqt | cut -d' ' -f 3 | grep lib | xargs cat | wc -c<br/>
> > 53583219<br/>
> ><br/>
> > So Qt uses about 50MB, GTK uses 15MB.<br/>
><br/>
> I get quite a different count:<br/>
><br/>
> fsb: >ldd /usr/lib/libqt-mt.so.3.3.8 | cut -d' ' -f 3 | xargs cat | wc -c<br/>
> 7172681
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">The libqt-mt library is only one lib of a qt program.</p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px 5px 0px;">
> fsb: >ldd /usr/lib/libgdk-x11-2.0.so.0 | cut -d' ' -f 3 | xargs cat | wc -c<br/>
> 9804745
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">And so is the libgdk of a gtk program. </p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px 5px 0px;">
<br/>
> 7 vs. 9 Mb. Just for the Qt/Gtk library.
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Please compare whole programs. </p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px 5px 0px;">
<br/>
> And that only size matters is not quite correct: for each library the number<br/>
> of symbols in the libraries must be resolved.<br/>
> The more libraries must be resolved, the more work there is for the linker.
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Since you gave no proof for this statement, I will answer with another unproven: </p>
<p style="margin: 0px;">The bigger a library the more code, the more symbols must be resolved. </p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">I don't know how to test the library loading time, but here are some timings of minimal gtk2/qt programs:</p>
<p style="margin: 0px;"> </p>
time ./testgtk2 <br/>
<p style="margin: 0px;"><br/>
real 0m0.035s<br/>
user 0m0.028s<br/>
sys 0m0.004s<br/>
<br/>
</p>
time ./testqt<br/>
<p style="margin: 0px;"><br/>
real 0m0.160s<br/>
user 0m0.088s<br/>
sys 0m0.032s<br/>
<br/>
</p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px 5px 0px;">
><br/>
> That was the main issue in KDE: to reduce the number of symbols to be<br/>
> resolved. This meant, less libraries.
</div><br/>
I doubt that combining several libs into one accelerates much.<br/>
<br/>
Mattias<br/>
<br/>
</body>
</html>