On Friday, 7 February 2014 at 16:41:00 UTC, Dmitry Olshansky wrote:

Meh. If exceptions are such a liability we'd better make them (much) faster.

It's not stack unwinding speed that's an issue here though, but rather that for client-facing services, throwing an exception when an invalid request is received gives malicious clients an opportunity to hurt service performance by flooding it with invalid requests. Improving the exception code specifically doesn't help here because the real issue is with GC collections. I'd say that the real fix is for such services to simply not throw in this case. But the exception could always be recycled as well (since in this case you know that throwing will abort the transaction and so will always be immediately discarded). I'm not convinced that there's any need for a language change here to support scoped exceptions. That seems a bit like killing the ant with a steamroller.

Reply via email to