The speed of exception handling !?!

Christoph Kulla Christoph.Kulla at
Mon Apr 6 07:05:45 PDT 1998

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

> 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 ?

More information about the kaffe mailing list