"Peter van Merkerk" <me*****@deadspam.com> wrote in message news:<bj************@ID-133164.news.uni-berlin.de>...
Does the use of exception handling induce a performance penalty during
the execution of non exception handling code?
It depends on which compiler yuo are using. There are several ways a
compiler can deal with exceptions so there is no standard answer to this. On
some compilers there is no performance penalty as long as no exception is
thrown. On others there is always a certain performance penalty, even when
no exceptions are thrown.
In C++ Programming Language 3rd edition section 14.8 Stroustrup writes
that it is possible to implement exception handling in such a way that
there is no run time overhead when no exception is thrown but it is
hard.
There is generally some overhead as we have to keep trach for the
local objects whose constructors have run, so when exception is thrown
their destructors are called. Their is detailed discussion about this
in "More effective C++" by Scott Meyer