Re: @try @catch
Re: @try @catch
- Subject: Re: @try @catch
- From: j o a r <email@hidden>
- Date: Thu, 14 Aug 2008 18:06:17 -0700
On Aug 14, 2008, at 5:34 PM, Andrew Farmer wrote:
Python has been optimized to handle exceptions quickly, so it's
often faster to catch exceptions than to check for exceptional
situations in Python code. Objective-C has not been similarly
optimized*, so checking for errors before attempting operations will
be much faster than catching exceptions unless the exceptions are
exceedingly rare.
*: Or, more accurately, the overhead of setting up exceptions is
much higher compared to the overhead of checking for situations that
would trigger them.
The cost, and where you pay it, depends on many factors: The type of
exceptions handler you use, and the version of Mac OS X and the
version of the Objective C runtime you happen to execute on.
That said, and has been pointed out earlier in this thread, the
decision to use exceptions for control flow or not is not simply one,
perhaps not even primarily one, of performance considerations.
j o a r
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden