4 ms·
Because the exception can’t be allowed to escape the function marked noexcept. No matter the actual implementation, the exception has to be effectively caught i
by epcoa 2y ago
Because the exception can’t be allowed to escape the function marked noexcept. No matter the actual implementation, the exception has to be effectively caught in that no except function.
- quotemstr 2y agoCatching is a table lookup in modern systems. I've yet to see a measurable happy path slowdown caused by adding noexcept.
- AshamedCaptain 2y agoWell TFA explains one. I also find it difficult to conceive of a case where adding noexcept would lead to slower/longer code, other than arbitrary noexcept overloads such as TFA.
- quotemstr 2y agoThe article describes the performance implications of the hash tables storing hashes. That it decides to do so based on examining noexcept() of passed in types doesn't make noexcept a pessimization itself
- AshamedCaptain 2y agoAnd, as you can see on the sibling thread where I'm being downvoted, there is an actual pessimization: since a noexcept function requires an eh_frame, it will not be able to tail-call (except for noexcept functions).