Re:Error codes are far slower than exceptions
by LorenPechtel on Tuesday November 24, 2020 @08:58PM
(#25205181)
99% of your code doesn't need optimization, period. If it's not inside at least two loops it almost certainly doesn't meaningfully contribute to the total runtime.
Re:Error codes are far slower than exceptions
by AstralStorm on Tuesday November 24, 2020 @10:15PM
(#25205651)
Except the one case where you have a slow approach diffused over a whole application, when all of the code needs an optimization.
That case is easy to hit with compilers or annotation and such features. It is still one thing to optimize but impact is typically big.
Re:Error codes are far slower than exceptions
by nwellnhof on Wednesday November 25, 2020 @05:41AM
(#25207816)
That's only true for application code. If you write libraries, you can't know how your library functions will be called and have to assume that most of them could end up in performance-critical code paths.
>Although it should fail gracefully, it does not need to be optimised for failure.