▲ | mpyne 6 days ago | |||||||
There's a time-space tradeoff to basically any means of error checking. Including checking return codes instead of exceptions. It's even possible for exceptions as implemented by g++ in the Itanium ABI to be cheaper than the code that would be used for consistently checking return codes. | ||||||||
▲ | Joker_vD 5 days ago | parent [-] | |||||||
Actually, there has been some research into building exceptions on the "basically, passing std::exception* into every function and checking what's inside it on every return" idea, and it was about as fast as the traditional table-based unwinding, took way less space in the executable, and re-throwing exceptions was actually faster [0][1] [0] https://news.ycombinator.com/item?id=22483028 [1] https://www.research.ed.ac.uk/portal/files/78829292/low_cost... | ||||||||
|