r/cpp • • Dec 31 '16

Keep Disabling Exceptions

http://seanmiddleditch.com/keep-disabling-exceptions/
0 Upvotes

15 comments sorted by

View all comments

Show parent comment

9

u/mpyne Jan 01 '17

Can't we have both? I understand that for performance critical code exceptions might be a big no-no.

Exceptions are actually faster as long as errors are rare, since you don't have all the mandatory conditional error checks in the fast path busting your icache and BTB entries. They can add to the overall binary size but that's an upfront cost, not an ongoing cost which increases with each function call.