News for hackers. Stuff that matters.
Re:C++ exception performance three years later by bestouff on Friday December 13, 2024 @08:29AM (#42408235)
Still that's awful. I way prefer the Rust way of "simulated exceptions" via Result return types (currently only available in nightly though).
Re:C++ exception performance three years later by kldx on Friday December 13, 2024 @11:23AM (#42409933)
Aren't we paying for Result types every time it's used? A result of a 64 bit value wouldn't fit into $eax for example (I understand there are exceptions to this rule through invalid bit pattern optimizations)
Re:C++ exception performance three years later by kldx on Friday December 13, 2024 @11:24AM (#42409951)
Apologies, I mean $rax
Re:C++ exception performance three years later by dataflow on Friday December 13, 2024 @09:46AM (#42408858)
std::expected?
Re:C++ exception performance three years later by jeffreygoesto on Saturday December 14, 2024 @03:52AM (#42415629)
Just be aware that this is a variant and can't be returned via a register, but needs the stack. In (very) hot paths it can be worth switching back to single return values.