Performance of exception handling

Sean Kelly sean at invisibleduck.org
Tue Apr 26 11:22:00 PDT 2011


On Apr 26, 2011, at 9:18 AM, Alexander wrote:

> On 26.04.2011 18:14, Sean Kelly wrote:
> 
>> It would be nice to generate them lazily but I don't think that's possible. 
> 
>  Why not? My brute-force approach works (temporarily disabling traceHandler), so why it couldn't be done more nicely somewhere in deh2 (I couldn't figure out yet, how exactly)?

Is your brute-force approach faster for entire app execution, or just try_main() execution?  It looks to me like you're just offloading tracing to the catch point, which in the case of an unhandled exception is after main() exits.  By lazily, I meant generating the trace in toString() or similar.  It might work for the typical case where the trace is pulled in the catch block or not at all, but if the exception is held until later before being inspected the lazy approach won't work.  Thread does this, for example, when it rethrows an uncaught exception from a call to join().


More information about the Digitalmars-d mailing list