3 ms·
> Unless you're arguing that it's better to just always have a 5% performance tax & manual, error-prone error handling? Exceptions today are untenable for a li
by randyrand 5y ago
> Unless you're arguing that it's better to just always have a 5% performance tax & manual, error-prone error handling?
Exceptions today are untenable for a library author because you don't know which input data your callers will use, and therefore can't predict how often errors will be thrown.
Ideally we'd fix c++ with better manual propagation of errors and compiler warnings, like Rust or Zig.
Even if the global mutex is fixed, the single threaded perf numbers are terrible if you hit a bunch of unexpected errors. That seems unfixable.
I'd rather have 5% slower code, than 5% faster code with occasional 1000% slow downs (in the worst case).
- kllrnohj 5y ago> I'd rather have 5% slower code, than 5% faster code with occasional 1000% slow downs (in the worst case). Perhaps, but that's a strawman through & through. C++ exceptions don't have that performance cliff when thrown, per both the paper in the OP & in your link. They are fairly cheap to throw assuming a single-threaded application. That is, the fib example with 10% failure rate has the same performance using exceptions & using Boost::LEAF. Unless you're calling it "unfixable" because there isn't actually anything to fix in the first place...