[jdom-interest] NoSuch*Exceptions in JDOM

Alex Chaffee guru at edamame.stinky.com
Mon Jul 10 11:26:40 PDT 2000

> Throwing and catching a new exception involves at least:
> - creating the exception
> - looking up the exception in a catch table
> This all performes badly as compared to returning a value.

As Petri recognized but didn't say explicitly, there is also the cost
of creating the message string to be stored in the exception.  This
cost is not just in time but in memory, since it usually leaves
StringBuffer droppings in the heap, meaning that GC must happen
sooner, which can be a big slowdown for a long-running app, like a

Alex Chaffee                       mailto:alex at jguru.com
jGuru - Java News and FAQs         http://www.jguru.com/alex/
Creator of Gamelan                 http://www.gamelan.com/
Founder of Purple Technology       http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/

More information about the jdom-interest mailing list