There is a cost associated with handling exceptions on some platforms and with some compilers.
Namely, when creating a 32-bit target, Visual Studio will register a handler in each function with local variables with a nontrivial destructor. Basically, it installs a try/finally handler.
Another method used by gcc and Visual Studio targeting 64-bit bits carries only overhead when throwing an exception (the method involves moving the call stack and searching the table). In cases where exceptions are rarely thrown, this can lead to more efficient code, since error codes should not be handled.
avakar Dec 13 '09 at 10:15 2009-12-13 22:15
source share