r/cpp • u/TheCrush0r • Oct 05 '26
Measuring the Performance of Deterministic Exceptions
https://databasearchitects.blogspot.com/2026/09/measuring-performance-of-deterministic.html
49
Upvotes
r/cpp • u/TheCrush0r • Oct 05 '26
View all comments
Show parent comment
7
u/serviscope_minor Oct 06 '26
>original exceptions (labeled dynamic) are faster in all nontrivial cases than error codes on happy path.
This is 100% true, but also kind of not.
What's really the case is one of the most popular implementations (Itanium ABI) does what you say and is in spec. It's also often unnecessarily slow on the sad path, but mostly because it's never seen much love. There's nothing in the standard that precludes a returned flag implementation of exceptions.
Incidentally that's what I don't really like about P0709: basically the entire paper has been a valid implementation of exceptions since the 1998 standard, and to feels kind of odd to have a special language feature so compilers can implement something they could already implement in one part and to work around the ever present problem of ABI issues as the other part.