Does D use zero-cost exceptions?

Nicholas Wilson iamthewilsonator at hotmail.com
Mon Apr 15 19:36:59 UTC 2019


On Monday, 15 April 2019 at 19:25:24 UTC, A wrote:
> It is well known that exceptions are much slower than their 
> alternatives, but is there a performance cost for using 
> try/catch, even when no Exception/Error is being thrown?

There is a space cost for the unwind tables, but exceptions are 
faster than checking error codes all over the place (you do check 
them right? ;) ).

If an error is thrown you application is dead (or UB) anyway.

Please use the learn forum for such questions in the future.


More information about the Digitalmars-d mailing list