[Issue 9584] Exceptions in D are ludicrously slow (far worse than Java)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 8 15:23:24 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=9584



--- Comment #23 from Adam D. Ruppe <destructionator at gmail.com> 2014-02-08 15:23:19 PST ---
(In reply to comment #21)
> Have you tried to run the D&Java benchmark attached to this Issue 9584 ?

I didn't run these specifically, I just did the try/catch Jonathan wrote. Let
me try them... the D one is much improved.

Before:
$ time ./except_d 5000
Exceptions: HI=2500 / LO=2500

real    0m0.840s

After:
$ time ./except_d 5000
Exceptions: HI=2500 / LO=2500

real    0m0.010s


Almost 100x better in this test. This is on Linux. druntime on git already has
a similar optimization for Windows, so a huge improvement should be seen there
on the next dmd release too.

Let's do 500,000 iterations with Java to hide the startup cost to be more fair
(note my Java stuff is old, it is jdk 1.6.0): 

$ time java except 500000
Exceptions: HI=250000 / LO=250000

real    0m0.666s

And D for 500000 runs
$ time ./except_d 500000
Exceptions: HI=250000 / LO=250000

real    0m0.758s


So we are a little bit slower for a large number of iterations but it is pretty
close now. (BTW compiling with -O -inline etc. makes no significant difference)
Certainly a lot better than before.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list