C++ exception throwing and catching are more costly than I realized. try{throw 123;} catch(int) {} costs 100 CPU clocks when run normally, 16,000 CPU clocks when run within a debugger, because of OS exception hooks and process switching mojo.
-
-
It depends on the language/exception mechanism. I remember hearing that Java's checked exceptions are implemented as expected path and are fast (but the unexceptional path is slightly slower as a result). .NET has slow exceptions.
-
Rust doesn't have 'exceptions', but its Result<,> returns and panics appear to mirror the fast and slow exception implementations. (Panics in Rust are normally only used when sketching or for programmer error, though. They can be caught but aren't normally proper error handling.)
End of conversation
New conversation -
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.