[Gllug] C/C++ mentor

Daniel P. Berrange dan at berrange.com
Tue Nov 21 20:49:20 UTC 2006


On Tue, Nov 21, 2006 at 07:52:22PM +0000, Mike Brodbelt wrote:
> salsaman wrote:
> 
> > However, libglade itself is quite nice - the recommended method now is
> > to generate interfaces using xml and libglade.
> 
> Of course that means your app depends on libglade, and has to pull in an
> XML parser every time it starts up. I can't help but think that this
> approach contributes to bloat, and a little careful coding time at the
> outset could save a lot of resources. Also ISTR last time I looked at
> Glade that there are a number of things that can be done with the widget
> set, but can't be done with Glade.

You might want to actually measure the 'bloat' from the XML parser or 
libglade. Picking a random GTK app using libglade....

For the process as a whole:

  Mapped:   87.68 MB

  Resident: 24.95 MB
    Shared:   12.92 MB
      Clean: 11.30 MB
      Dirty: 664.00 kb
    Private:   12.04 MB
      Clean: 988.00 kb
      Dirty: 12.04 MB
  Unmapped: 62.72 MB

And picking the mappings associated with GTK:

                                           |                     Resident
                                           |            Shared             Private
                                  Mapped   |      Clean       Dirty      Clean      Dirty
                              ------------------------------------------------------------
libglade-2.0.so.0.0.7         :   92.00 kb |      84.00 kb    0 bytes    4.00 kb    0 bytes
libglade-2.0.so.0.0.7         :    4.00 kb |       0 bytes    0 bytes    0 bytes    4.00 kb
libglib-2.0.so.0.1200.3       :  628.00 kb |     388.00 kb    0 bytes    0 bytes    0 bytes
libglib-2.0.so.0.1200.3       :    4.00 kb |       0 bytes    0 bytes    0 bytes    4.00 kb
libgtk-x11-2.0.so.0.1000.4    :    3.57 MB |    1964.00 kb    0 bytes    0 bytes    0 bytes
libgtk-x11-2.0.so.0.1000.4    :   24.00 kb |      12.00 kb    0 bytes    0 bytes   12.00 kb
libgdk-x11-2.0.so.0.1000.4    :  552.00 kb |     404.00 kb    0 bytes    0 bytes    0 bytes
libgdk-x11-2.0.so.0.1000.4    :   12.00 kb |       8.00 kb    0 bytes    0 bytes    4.00 kb
libpangocairo-1.0.so.0.1400.6 :   32.00 kb |      28.00 kb    0 bytes    0 bytes    0 bytes
libpangocairo-1.0.so.0.1400.6 :    4.00 kb |       0 bytes    0 bytes    0 bytes    4.00 kb
libxml2.so.2.6.27             : 1204.00 kb |     388.00 kb    0 bytes   72.00 kb    0 bytes
libxml2.so.2.6.27             :   20.00 kb |       4.00 kb    0 bytes    0 bytes    8.00 kb

So the 'bloat' from the XML parser consists of 388 KB shared across all
applications on the system, and 72 kb private to each app. This is
a rounding error in the greater scheme of things where the app has
12 MB of private mappings just from other runtime data.

By all means attack bloat in Linux applications - there's certainly
plenty of it - but pick a better target than the XML parser / libglade.

Regards,
Dan.
-- 
|=-            GPG key: http://www.berrange.com/~dan/gpgkey.txt       -=|
|=-       Perl modules: http://search.cpan.org/~danberr/              -=|
|=-           Projects: http://freshmeat.net/~danielpb/               -=|
|=-   berrange at redhat.com  -  Daniel Berrange  -  dan at berrange.com    -=|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20061121/3cd6c662/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list