I’ve been seeing various bits and pieces mentioning the overhead Ruby’s
(and other languages’) exception handling adds to a program (eg.
comments on
http://rpheath.com/posts/237-raising-custom-exceptions-in-rails, and
How slow are (Ruby) Exceptions? - RubyFlow).
Is that overhead incurred even if the exception is not raised? That is;
the negatives are only felt if the exception is raised, and so should
not be used for normal program flow control, or is it better to avoid
begin…rescue…end blocks wherever possible (if trying to improve your
performance)?
Thanks.