[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 22:40:57
[Download RAW message or body]

On Čt, 17 čen 1999, Alex Zepeda wrote :
>On Wed, 16 Jun 1999, Lubos Lunak wrote:
<snip>
>>  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,
>
>Such as someone using CORBA?

Oops, I was talking about KDE 1.x here ( and forgot to mention that ), I don't
know that much about 2.x.

>
>> 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.
>
>Unless your program malfunctions because of this and you get a whole lot
>of bad press..

 Well, if someone write app for 1.x which uses exceptions and needs libs
compiled with exceptions, he/she can notice in the docs 'make sure you have
exceptions-aware libs'.
 Hmm, I got an interesting idea. I think it wouldn't be that difficult to make
some argument for configure, let's say '--disable-exceptions' and let the user
to decide, and also have -fexceptions and -fno-exceptions versions of kdelibs
rpms ( debs, ... whatever ). Most users would simply install the smaller one,
and those using ksirc or some app saying 'you need exceptions' would simply
have to use the other one.
 I think it's _really_ worth it. Today I recompiled kdelibs and qt with
-fno-exceptions and now I have only cca 25 MB RAM used after logging into KDE
( + 15 cache + 8 free = 48 total ), yesterday it was cca 34 MB ( I run 9 docked
apps, so they make this big difference ). Now I even don't think that people
who claim KDE runs fine with 16MB are crazy :). I think making this would
also make some people realize that KDE is actually not that much bloated. And
look at kde@kde.org how many people are asking about how to reduce the memory
usage. I think it would make them happy to give them also such version and they
wouldn't mind they can't run app(s) that they maybe don't run at all anyway.
 Anyway, at least apps in 1.1.2 which don't use exceptions should be
definitely compiled with -fno-exceptions.
 And, finally, I think 2.0 will be out before there are many apps using
exceptions.

>
>> And there's also another way how to reduce the "bloat" caused by
>> exceptions - to really use them :).
>
>They are used :)  (Perhaps for KDE 1.1.2, disabling exceptions wouldn't be
>a horrible idea, but it *might* break ksirc and it wouldn't really fix
>anything).
>
>Besides, you'd probably gain a bigger memory savings by working to reduce
>kdelibs's memory consumption.  For instance there's a lot of temporary
>variables (counters and intermediate QStrings and the like) that could be
>trimmed, there's dead classes (KClipboard?), dead code (anything that uses
>QStrList) and so-on.  It may not provide the immediate results that
>disabling exceptions might have, but it'll provide more of a longterm
>benefit.

This is true. For example, my KHotKeys, SIZE-SHARE is still 550kB ( it was
1.1MB if I remember correctly before -fno-exceptions ), and it has minimal
binary size and memory requirements. Oh, but that again me talking about 1.x
and you about 2.0 .

 Lubos Lunak
 l.lunak@email.cz

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

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