On 2/8/14, 9:00 PM, Marco Leise wrote:
Am Sat, 08 Feb 2014 14:01:12 -0800
schrieb Walter Bright <[email protected]>:
On 2/7/2014 8:40 AM, Dmitry Olshansky wrote:
Meh. If exceptions are such a liability we'd better make them (much) faster.
They can be made faster by slowing down non-exception code.
This has been debated at length in the C++ community, and the generally accepted
answer is that non-exception code performance is preferred and exception
performance is thrown under the bus in order to achieve it.
I think it's quite a reasonable conclusion.
https://yourlogicalfallacyis.com/black-or-white
The reasons for slow exceptions in D could be the generation
of stack trace strings or the garbage collector instead of
inherent trade offs to keep the successful code path fast.
This threads is about memory allocation, not exceptions being slow.
And static allocation isn't an exactly appealing option...
throw staticException ? staticException : (staticException =
new SomethingException("Don't do this at home kids!"));
Function calls could do that.
Andrei