[jdom-interest] NoSuch*Exceptions in JDOM
Andre Van Delft
avandelft at epo.org
Mon Jul 10 09:28:34 PDT 2000
Petri Wessman wrote:
> On Mon, 10 Jul 2000 08:38:44 -0500, Brett McLaughlin <brett.mclaughlin at lutris.com> said:
> >> Beside the "is it good design" argument, you should take into account
> >> the fact that throwing and catching exceptions carries a heavy
> >> performance penalty in Java. There is a good, practical reason for
> Brett> Where is your documentation for this? I don't believe that this is
> Brett> accurate, but I'm willing to be proved wrong. Could you post docs or a
> Brett> URL?
> Well, I don't have any handy right now, it's a point that has come up
> in various JavaWorld articles on Java performance, and I remember at
> least two speakers at last year's Java One commenting on it.
Some information is in
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.
It seems that JavaWorld would vote for a getChild that
does not throw exceptions. See:
>The most important point to take away from this article is that
>exceptions are there for abnormal conditions and
>shouldn't be used to report conditions that can be
>reasonably expected as part of the everyday functioning
>of a method.
More information about the jdom-interest