[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: A note to exceptions && some notes to codesize
From:       Lubos Lunak <l.lunak () sh ! cvut ! cz>
Date:       1999-06-16 21:17:15
[Download RAW message or body]

On Pá, 11 čen 1999, Waldo Bastian wrote :
>
<snip>
>> However, you'll also gain a decent savings by
>> disabling exception handling in applications that don't use exceptions.
>
>We should at least start with that then.

Well, I thought the configure script does this, before I realized this :
[root@seli kdeadmin-1.1.1]# ./configure && make
creating cache ./config.cache
checking host system type... i586-pc-linux-gnu
checking target system type... i586-pc-linux-gnu
<snip>
checking if g++ supports -fno-rtti -fno-exceptions ... yes
<snip>
make[3]: Entering directory `/mnt/main/home/seli/wrk_tmp/kdeadmin-1.1.1/kdat'
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/opt/kde/include -I/usr/lib/qt/include 
-I/usr/X11R6/include    -O2 -Wall -c Archive.cpp
<etc etc>

Why does it check if g++ supports -fno-exceptions when it actually doesn't use
it ? While compiling most of the applications with -fno-exceptions doesn't seem
to change the memory usage much ( 8kB for kwrite, bah ), it at least noticeably
decreases the size of the binary file.
 Libraries seem to affect the memory usage much more than the application
itself, recompiling kdelibs-1.1.1 with -fno-exceptions decreases the memory
usage by 500Kb per running app on my Linux ( and I wonder why all KDE apps need
so much memory, the exception tables are not shared ? ). Compiling the
libraries without exceptions support could be a problem for someone who would
really want to use them, but saving several megs of RAM is IMHO worth it (
Miguel the Big Mouth : 'KDE ... uses up too much memory' ; me : 'when I last
tried Gnome it used even more'  :-> ). Well, in the end, replacing
-fno-exceptions version of kdelibs with -fexceptions one is not that difficult
if it would be really needed.
 I also thought that changing 'void foo();' to 'void foo() throw();' where
possible could reduce the number of calls to __throw(), but egcs ( 1.1.2 )
seems to happily ignore this information ( or maybe I'm wrong ).

 Lubos Lunak
 l.lunak@email.cz

And there's also another way how to reduce the "bloat" caused by exceptions -
to really use them :).

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic