November 08
On Thursday, 8 November 2018 at 07:54:56 UTC, Manu wrote:
> On Wed, Nov 7, 2018 at 10:30 PM Vladimir Panteleev via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>>
>> On Thursday, 8 November 2018 at 06:08:20 UTC, Vladimir Panteleev wrote:
>> > It was definitely about 4 seconds not too long ago, a few years at most.
>>
>> No, it's still 4 seconds.
>>
>> digger --offline --config-file=/dev/null -j auto -c local.cache=none build     7.31s user 1.51s system 203% cpu 4.340 total
>>
>> > It does seem to take more time now; I wonder why.
>>
>> If it takes longer, then it's probably because it's being built in one CPU core, or in the release build.
>
> https://youtu.be/msWuRlD3zy0
>
> DMD only builds with one core, since it builds altogether.
> And all builds are release builds... what good is a debug build? DMD
> is unbelievably slow in debug. If it wasn't already slow enough... if
> I try and build with a debug build, it takes closer to 5 minutes.
>
> I suspect one part of the problem is that DMD used to be built with a C compiler, and now it's built with DMD... it really should be built with LDC at least?

The problem definitely looks like is with your Windows. Perhaps it's caused by an antivirus software? For the record on my machine it's consistently below 4sec. See:
https://asciinema.org/a/G5lLRPsLLMb5IaqPrmhZagop4

November 08
On Thursday, 8 November 2018 at 07:54:56 UTC, Manu wrote:
> https://youtu.be/msWuRlD3zy0
>
> DMD only builds with one core, since it builds altogether.
> And all builds are release builds... what good is a debug build? DMD
> is unbelievably slow in debug. If it wasn't already slow enough... if
> I try and build with a debug build, it takes closer to 5 minutes.

I think the default posix.mak target is neither a debug nor a release build, meaning it is neither optimized nor has the additional asserts/invariants of a debug build. Not sure the Visual Studio solution has that, but perhaps it could be an acceptable middle ground.

> I suspect one part of the problem is that DMD used to be built with a C compiler, and now it's built with DMD...

Well, my latest test was against master, that even has parts of the backend apparently converted to D, so I'm not sure that's relevant.

November 08
On Thursday, 8 November 2018 at 14:33:34 UTC, Petar Kirov [ZombineDev] wrote:
> On Thursday, 8 November 2018 at 07:54:56 UTC, Manu wrote:
>> On Wed, Nov 7, 2018 at 10:30 PM Vladimir Panteleev via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>>>
>>> On Thursday, 8 November 2018 at 06:08:20 UTC, Vladimir Panteleev wrote:
>>> > It was definitely about 4 seconds not too long ago, a few years at most.
>>>
>>> No, it's still 4 seconds.
>>>
>>> digger --offline --config-file=/dev/null -j auto -c local.cache=none build     7.31s user 1.51s system 203% cpu 4.340 total
>>>
>>> > It does seem to take more time now; I wonder why.
>>>
>>> If it takes longer, then it's probably because it's being built in one CPU core, or in the release build.
>>
>> https://youtu.be/msWuRlD3zy0
>>
>> DMD only builds with one core, since it builds altogether.
>> And all builds are release builds... what good is a debug build? DMD
>> is unbelievably slow in debug. If it wasn't already slow enough... if
>> I try and build with a debug build, it takes closer to 5 minutes.
>>
>> I suspect one part of the problem is that DMD used to be built with a C compiler, and now it's built with DMD... it really should be built with LDC at least?
>
> The problem definitely looks like is with your Windows. Perhaps it's caused by an antivirus software? For the record on my machine it's consistently below 4sec. See:
> https://asciinema.org/a/G5lLRPsLLMb5IaqPrmhZagop4

I don't think it's just *his* Windows - DMD builds on my Windows 10 Core i3 laptop with anti-virus disabled in about 1m 40s too. And it's always taken about this long, even when the source was C++. I'm tempted to try it on Linux on the same machine to see what I'm missing out on.
November 08
On Thursday, 8 November 2018 at 16:51:55 UTC, John Chapman wrote:
>
> I don't think it's just *his* Windows - DMD builds on my Windows 10 Core i3 laptop with anti-virus disabled in about 1m 40s too. And it's always taken about this long, even when the source was C++. I'm tempted to try it on Linux on the same machine to see what I'm missing out on.

BTW, last time I tried WSL it had similar performance to Linux, IIRC. Perhaps this is why I haven't noticed such slow downs when building dmd on the machines I tried.
November 08
On 2018-11-08 05:16, Manu wrote:

> 4 seconds? That's just untrue. D is actually kinda slow these days...
> In my experience it's slower than modern C++ compilers by quite a lot.

This is my result on macOS:

$ $ make -f posix.mak clean
$ time make -f posix.mak -j 16
real	0m3.127s
user	0m5.478s
sys	0m1.686s

-- 
/Jacob Carlborg
November 08
On Thu, Nov 08, 2018 at 06:25:06PM +0100, Jacob Carlborg via Digitalmars-d-announce wrote:
> On 2018-11-08 05:16, Manu wrote:
> 
> > 4 seconds? That's just untrue. D is actually kinda slow these days...  In my experience it's slower than modern C++ compilers by quite a lot.
> 
> This is my result on macOS:
> 
> $ $ make -f posix.mak clean
> $ time make -f posix.mak -j 16
> real	0m3.127s
> user	0m5.478s
> sys	0m1.686s
[...]

Result on Debian/Linux (amd64):

real    0m8.445s
user    0m11.088s
sys     0m1.453s


Slower than C++ compilers?! That's impossible.  There must be something wrong with your setup, or else with your OS.  Dmd is easily one of the fastest compilers I've ever used, even after the noticeable slowdown when we started bootstrapping from D. G++, for example, is at least an order of magnitude slower.  On my system, anyway. YMMV obviously.

(Of course, it depends on what D features you use... template-heavy and CTFE-heavy code tends to slow it down pretty badly. But still, it's pretty fast compared to g++.)


T

-- 
Who told you to swim in Crocodile Lake without life insurance??
November 08
On 2018-11-08 18:25, Jacob Carlborg wrote:

> This is my result on macOS:
> 
> $ $ make -f posix.mak clean
> $ time make -f posix.mak -j 16
> real    0m3.127s
> user    0m5.478s
> sys    0m1.686s

21 seconds on a Windows 10 virtual machine compiling using the win32.mak file.

-- 
/Jacob Carlborg
November 08
On Thursday, 8 November 2018 at 19:07:32 UTC, Jacob Carlborg wrote:
> 21 seconds on a Windows 10 virtual machine compiling using the win32.mak file.

Sounds like we're narrowing it down to the Visual Studio solution.

November 08
On Thursday, 8 November 2018 at 20:19:47 UTC, Vladimir Panteleev wrote:
> On Thursday, 8 November 2018 at 19:07:32 UTC, Jacob Carlborg wrote:
>> 21 seconds on a Windows 10 virtual machine compiling using the win32.mak file.
>
> Sounds like we're narrowing it down to the Visual Studio solution.

Well, I'm just using win32.mak in a command prompt and it takes ~1m 40s to build DMD. It just seems to do nothing for most of that time.
November 08
On Thursday, 8 November 2018 at 20:19:47 UTC, Vladimir Panteleev wrote:
> Sounds like we're narrowing it down to the Visual Studio solution.

Mildly interested, I gave DMD master a shot with my 5-years old i5-3550 (@4 GHz) in VS 2017 (+ a recent Visual D beta):

DMD v2.083.0-beta1 host compiler
---
Win32-Debug:      12 secs
Win32-Release: 1m 58 secs

LDC v1.13.0-beta1 host compiler
---
Win32-Debug:      22 secs
Win32-Release: 1m 28 secs

DMD's `-inline` is known to be *slow*.
1 2 3 4 5