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

List:       kde-core-devel
Subject:    Re: Memory Usage in KDE (LONG)
From:       Waldo Bastian <bastian () suse ! de>
Date:       1999-10-18 16:23:33
[Download RAW message or body]

On Mon, 18 Oct 1999, Lars Knoll wrote:
> Hi,
> 
> On Mon, 18 Oct 1999, Waldo Bastian wrote:
> [lots of interesting statistics about memory usage of exceptions deleted]
> 
> > * The overhead of exception handling is huge.
> > * Qt and KDE should be compiled without support for exception handling.
> > * The use of exceptions is depreciated.
> > * Applications or libraries which need exception handling should enable
> > it for themselves and make sure not to throw any exceptions to code
> > which does not support it, including Qt. (Take expecially care of
> > signals/slots and virtual functions)
> 
> These numbers are really interesting. I agree with you, that the memory
> usage is huge. However, I don't like disabling exception handling in the
> libs for one reason. People _will_ write software using exceptions and qt,
> if we want them to or not. If we disable exception handling in the
> libraries, they will run into trouble, because of Qt's signals/slots. With
> them it is easily possible, that the programmer throws an exception in a
> function called from the signal in the library. 

Question: Who will catch this exception?

> I think, the last point in
> your list above is almost impossible to fullfill. If you do event based
> programming in Qt, perhpas 80% of your code will be called from signals,
> and thus from within the Qt library.
> 
> And I have problems removing exceptions from khtml, because the DOM
> standard requires them. One could perhaps work around it using return
> codes, but it would make the code and API really ugly und IMO almost
> unusuable.

Ksirc uses exceptions and runs fine linked against libraries which
don't support exceptions. So I assume that you can compile libkhtml
with exception support enabled while having it disabled in other
libraries. You just have to be carefull with what you do (e.g. don't
use signals/slots).

I really don't see why every application would need to pay a > 1Mb
memory penalty because some people want to use exeptions. I don't care
if you want to add bloat to your own code, but it shouldn't affect
others.

> Also, I don't really understand, why exception handling should need such
> huge, unshared data segments. Have you thought about talking to the egcs
> guys about this problem? 

I have no idea. I will forward my findings to them.

Cheers,
Waldo

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

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