Backend nearly entirely converted to D

Joakim dlang at joakim.fea.st
Thu Nov 8 08:40:37 UTC 2018


On Wednesday, 7 November 2018 at 21:40:58 UTC, welkam wrote:
> On Wednesday, 7 November 2018 at 14:39:55 UTC, Joakim wrote:
>>
>> I don't know why you think that would matter: I'm using the 
>> same compilers to build each DMD version and comparing the 
>> build times as the backend was translated to D
>
> What did you compared is whether clang or DMD compiles code 
> faster not whether D code compiles faster than C++. To check 
> that you should compile both C++ and D with the same backend.

I'm not making any general statements about whether C++ or D 
compiles faster, only pointing out that in a common setup of 
building dmd with clang and dmd on linux/x64, I didn't see much 
of a speed gain. However, I did mention that the frontend should 
be removed to really measure the backend conversion, so that's 
what I just did.

I built the backends for DMD 2.080.1 through master in the same 
single-core VPS by slightly modifying src/posix.mak, only 
replacing the line "all: $G/dmd" with "all: $G/backend.a". Here 
are the results I got and how many D files were built in each 
backend:

2.080.1 - 1D  8.0s
2.081.2 - 4D  7.2s
2.082.1 - 27D 6.9s
2.083.0 - 45D 5.6s
master d398d8c - 50D 4.3s

So the frontend might have been obscuring things, as we see a 
clear win from moving the backend to D, with only about 10 C/C++ 
files left in the backend now and compilation time cut almost in 
half. I think we'll see even more of a gain if the D files in the 
backend are built all at once.


More information about the Digitalmars-d-announce mailing list