my first D program (and benchmark against perl)

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Nov 11 07:58:03 PST 2015


On Wed, Nov 11, 2015 at 02:26:28PM +0000, Andrea Fontana via Digitalmars-d-learn wrote:
> On Wednesday, 11 November 2015 at 13:32:00 UTC, perlancar wrote:
> >While I am quite impressed with how easy I was able to write D, I am
> >not so impressed with the performance. Using rdmd (build 20151103),
> >the D program runs in 17.127s while the Perl version runs in 11.391s
> >(so the D version is quite a bit *slower* than Perl's). While using
> >gdc (Debian 4.9.2-10), I am able to run it in 3.988s (only about 3x
> >faster than Perl's version).
> >
> >I understand that string processing (concatenation, allocation) is
> >quite optimized in Perl, I was wondering if the D version could still
> >be sped up significantly?
> 
> Did you try rdmd -O -noboundscheck -release yourscript.d ?
[...]

If performance is a problem, my first reaction would be to try GDC or
LDC.  While there have been recent improvements in DMD code generation
quality, it still has a ways to go to catch with GDC/LDC's optimizer.


T

-- 
Старый друг лучше новых двух.


More information about the Digitalmars-d-learn mailing list