Bug 5892 – Lazy evaluation of stack trace when exception is thrown
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2011-04-26T07:32:00Z
Last change time
2014-03-19T17:53:19Z
Assigned to
nobody
Creator
aldem-dmdbugs
Comments
Comment #0 by aldem-dmdbugs — 2011-04-26T07:32:45Z
Currently, on every throw statement, traceHandler is invoked, which significantly slows down exception handling.
It would be nice to invoke traceHandler only if there is no user-defined catch specified (if there is one, stack-trace is not [or rarely] used, AFAIK).
This should improve exception handling performance drastically (more than 1000x in my test).
Comment #1 by bearophile_hugs — 2011-04-26T09:51:29Z
Comment #2 by lt.infiltrator — 2014-03-19T17:50:03Z
Has anybody implemented this yet?
Comment #3 by destructionator — 2014-03-19T17:53:19Z
Yeah, the git version of dmd has it implemented for Windows (not sure who wrote that) and Posix (I did that in another bug report).
Led to a *huge* speedup, 100-1000x depending on who ran the tests, making us competitive with if not faster than Java.
I'll mark this as fixed as the next dmd release will have the new code.