The speed of exception handling !?!

Tim Wilkinson tim at
Mon Apr 6 13:18:40 PDT 1998

There's no public CVS yet, but I make a nightly snapshot and put it on the ftp
server (it's called kaffe-snap.tar.gz).


Christoph Kulla wrote:

> Tim Wilkinson <tim at> writes:
> > I suppose I always considered exceptions to be, well the exception - so
> > the speed didn't really matter.  But now someone's demonstrated how
> > awful it actually is I thought I'd take a look.
> In some applications exceptions are very usefull to control the control flow
> of the proram. In some of my programms a thousand exceptions are generated
> per minute (writing a pattern matcher - developing an interpreter for a
> rule based language). Kaffe slows things down. In my oppinion many people
> dont´t use exceptions because they think that exceptions should be only the
> exception. But it´s a rich feature of modern languages, which makes life
> easier.
> > Seems to me that the thing to do is not so much fixup findMethodFromPC
> > (though this would undoubtable help) but to avoid calling it in the
> > first place.  At the moment an exception constructs an array of
> > character strings to hold the backtrace (rather like how Sun's JVM does
> > it I believe).  This is basically stupid - instead you should build an
> > array of Method/PC pairs (or for the JIT just PC's) and only construct
> > the textual backtrace on demand.
> :-)
> > I've now implemented this and will upload it to CVS in the next few
> > days.  I haven't done any timings yet but it should essentially
> > eliminate the need to call findMethodFromPC except when you actually
> > want to print the backtrace info.  Any thrown and caught exceptions will
> > never need to call it.
> I do the timings :-).
> Is this what you call the final version 10.0 ? Is there a public CVS account ?

  Tim Wilkinson                         Tel:     +1 510 704 1660
  Transvirtual Technologies, Inc.,      Fax:     +1 510 704 1893
  Berkeley, CA, USA.                    Email:   tim at

More information about the kaffe mailing list