C++ Exception Performance Insights and Alternatives

Viewed 89
Recent discussions about C++ exception performance highlight differences between traditional DWARF exceptions and the SJLJ (setjmp/longjmp) model. DWARF exceptions incur significant overhead, making them slower during exception handling while keeping non-exceptional code fast. SJLJ generally offers better performance for exception throwing but adds overhead to non-exceptional paths. There are ongoing debates regarding the tradeoffs of using exceptions in programming languages and opinions supporting alternatives like Zig for error handling, stressing a preference for more straightforward error management approaches. Some users also question the performance of Windows EH, expressing interest in benchmarks comparing its efficacy to DWARF and SJLJ.
0 Answers