Just eliminated C++ exceptions in a complicated multithreaded library. It’s 15% faster despite all performance sensitive functions previously being declared noexcept, with no obvious explanation.
-
-
This cost is mind-boggling for what is essentially a goto-with-destructors. In the process of adopting the “zero cost exceptions” fallacy, modern platforms created a catastrophic performance cliff that makes the feature unusable in real software.
Show this thread -
And it’s not just C++. Other languages build their exception models on top of C++ exceptions and the operating system level plumbing (why should the OS have anything to do with this?) so, for example, JavaScript exceptions are also impractically expensive.
Show this thread
End of conversation
New conversation -
-
-
I remember that from win32 on x86, where exceptions seemed reasonably fast. On x64, there is no trace of exception tracking in mainline code, but some horrible handler that digs through the executable file to find tables of exception handlers.
End of conversation
New conversation -
-
-
i don’t know what i just read but good on you tim :)
- End of conversation
New conversation -
-
-
Using the debug heap alone (even if not attaching a debugger) is a huge performance killer on Windows, too.
-
I always use _NO_DEBUG_HEAP=1 when debugging and performance is still critical
End of conversation
New conversation -
-
-
Out of curiosity, any idea why clang exception handling would be so much more expensive?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.