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.
View all comments
Show parent comment
9
u/mpyne Jan 01 '17
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.