Is there a performance penalty associated with calling a function within a @try block?

objective-c

Solution

from doc

Zero-Cost @try Blocks

64-bit processes that enter a zero-cost @try block incur no performance penalty. This is unlike the mechanism for 32-bit processes, which calls setjmp() and performs additional “bookkeeping”. However, throwing an exception is much more expensive in 64-bit executables. For best performance in 64-bit, you should throw exceptions only when absolutely necessary.

so no overhead for 64-bit processes

Problem

Would this cause a performance penalty, compared to calling `blabla` without the try block? ``` -(void)bla{ @try{ [self blabla]; } @catch (NSException *e) { // Do nothing } } ```

Original source

Related problems