r/cpp • u/TheCrush0r • Oct 05 '26
Measuring the Performance of Deterministic Exceptions
https://databasearchitects.blogspot.com/2026/09/measuring-performance-of-deterministic.html
52
Upvotes
r/cpp • u/TheCrush0r • Oct 05 '26
View all comments
Show parent comment
1
u/ABlockInTheChain Oct 22 '26
The idea that exceptions should be rare is a workaround for a performance reality rather than a universal philosophy that would hold in an alternate universe where exceptions had good performance in all case.
In that alternate universe where throwing exceptions had a predictable, reasonable runtime cost the focus would have been on the ergonomic tradeoffs: when does it improve readability and maintainability to handle errors immediately when they occur vs when is it better to write a happy path in a
tryblock and defer error handling to the subsequentcatchblocks or to the caller.