[J3] [EXTERNAL] Re: Exception handling - Golang proposal
Ondřej Čertík
ondrej at certik.us
Wed Jul 24 17:44:57 EDT 2019
On Wed, Jul 24, 2019, at 2:53 PM, Van Snyder via J3 wrote:
> On Wed, 2019-07-24 at 14:46 -0600, Ondřej Čertík via J3 wrote:
> > As the Golang proposal mentions, it might not be worth doing, but I
> > think it's a clean solution that would not preclude the compiler from
> > doing optimizations, which many of the traditional exception
> > mechanisms would. And so it is worth considering the Pros and Cons.
>
> I keep hearing the opinion that block-structured exception handling
> interferes with optimization. My contacts in the Ada community say
> that's nonsense. Maybe developers of other languages' compilers just
> haven't figured it out.
>
> If the semantic description of block-structured exception handling in
> the standard for some language inevitably results in optimization
> problems, I'd be interested to know what those specifications are,
> rather than vague handwaving -- that has been contradicted by people who
> have done it well.
Sure. The C++ paper I posted (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf), page 8, point (1) discusses details of that.
Here are some cases where people have found that disabling exceptions in the C++ compiler speeds things up:
https://www.reddit.com/r/cpp/comments/3uqwoq/benchmark_shows_exceptions_have_no_overhead_on_g/
https://preshing.com/20110807/the-cost-of-enabling-exception-handling/
Ondrej
More information about the J3
mailing list