
czw., 13 kwi 2023 o 10:43 Andrey Semashev via Boost
On 4/13/23 06:08, Darrell Wright via Boost wrote:
One thing I learned in my own replacement is that exit_success is heavily penalized on MSVC, even when there is no possible exception, because of the call to uncaught_exceptions that isn’t optimized. It’s a good thing to document, if not already, as it is surprising.
Well, a certain amount of overhead is expected, since the added condition is there and not likely to be optimized away. However, I would expect uncaught_exceptions() to be cheap, as it should simply read an integer from TLS.
It looks like the call to std::uncaught_exceptions() is not optimized out, even in -O3: https://godbolt.org/z/PYEjP5PYY
I wonder how std::uncaught_exceptions() compares to our custom implementation in boost::core::uncaught_exceptions(). Perhaps, I should benchmark it.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost