D dropped in favour of C# for PSP emulator

Marco Leise Marco.Leise at gmx.de
Thu May 17 12:29:18 PDT 2012


Am Mon, 14 May 2012 10:19:40 +0200
schrieb "Jakob Bornecrantz" <wallbraker at gmail.com>:

> On Saturday, 12 May 2012 at 23:27:15 UTC, Alex Rønne Petersen
> wrote:
> >
> > You know, my project consisting of 130-ish source files and 
> > 24.000-ish lines of code compiles from scratch in ~20 seconds 
> > on my machine, building one file at a time... I honestly have 
> > not managed to come up with a build system for D that is 
> > actually slow, if compared to C/C++.
> 
> Try using GDC the compiler that can actually produce good code,
> or using -inline -release flags.
> 
> Debug build (GDC, multi invocation, 3 threads)
> real	0m42.452s
> 
> Release build (GDC, multi invocation, 3 threads)
> real	1m0.140s
> 
> Debug build (GDC, single invocation)
> real	0m22.151s
> 
> Release build (GDC, single invocation)
> real	0m54.960s
> 
> $ find src/ -name "*.d" | xargs wc -l | tail --lines 1
>      46057 total
> 
> Cheers, Jakob.

This is true. Once you decide to use GDC for whatever reason (chances of inclusion into GCC, better optimization, ...) you are also about 1 revision behind the DMD release. I usually assume that GDC 2.057 code will compile on DMD 2.059, but not the reverse. So I never actually use DMD any more to remember how fast it compiles. He could have made a similar experience.

Also I see a lot of you compare D with C/C++ compilation times, whereas the author was finally deciding for C#. I believe he used that language before and it probably has a compiler with comparable speed to DMD (e.g. much faster than GDC). After all a C# compiler can compile to simplistic byte code for a VM with much less real world constraints. Often compilers for VM languages come with the compiler integrated into the standard library, allowing for easy integration into IDEs and further optimizations of the compile time. I remember Delphi (not as a VM language) had the compiler and linker integrated into the IDE which made single file rebuilds practically instantaneous.

-- 
Marco



More information about the Digitalmars-d mailing list