November 07, 2018
On Tue, Nov 6, 2018 at 10:05 AM Vladimir Panteleev via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>
> This is a tool + article I wrote in February, but never got around to finishing / publishing until today.
>
> https://blog.thecybershadow.net/2018/02/07/dmdprof/
>
> Hopefully someone will find it useful.

"Indeed, a clean build of DMD itself (about 170’000 lines of D and 120’000 lines of C/C++) takes no longer than 4 seconds to build on a rather average developer machine."

...what!? DMD takes me... (compiling) ... 1 minute 40 seconds to build! And because DMD does all-files-at-once compilation, rather than separate compilation for each source file, whenever you change just one line in one file, you incur that entire build time, every time, because it can't just rebuild the one source file that changed. You also can't do multi-processor builds with all-in-one build strategies.

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.

November 07, 2018
On Wed, Nov 7, 2018 at 8:16 PM Manu <turkeyman@gmail.com> wrote:
>
> On Tue, Nov 6, 2018 at 10:05 AM Vladimir Panteleev via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
> >
> > This is a tool + article I wrote in February, but never got around to finishing / publishing until today.
> >
> > https://blog.thecybershadow.net/2018/02/07/dmdprof/
> >
> > Hopefully someone will find it useful.
>
> "Indeed, a clean build of DMD itself (about 170’000 lines of D and 120’000 lines of C/C++) takes no longer than 4 seconds to build on a rather average developer machine."
>
> ...what!? DMD takes me... (compiling) ... 1 minute 40 seconds to build! And because DMD does all-files-at-once compilation, rather than separate compilation for each source file, whenever you change just one line in one file, you incur that entire build time, every time, because it can't just rebuild the one source file that changed. You also can't do multi-processor builds with all-in-one build strategies.
>
> 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.

Also, in my experience, DMD seems to build a LOT slower now that it's in D than it used to when it was C++.

November 07, 2018
On Wed, Nov 7, 2018 at 8:18 PM Manu <turkeyman@gmail.com> wrote:
>
> On Wed, Nov 7, 2018 at 8:16 PM Manu <turkeyman@gmail.com> wrote:
> >
> > On Tue, Nov 6, 2018 at 10:05 AM Vladimir Panteleev via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
> > >
> > > This is a tool + article I wrote in February, but never got around to finishing / publishing until today.
> > >
> > > https://blog.thecybershadow.net/2018/02/07/dmdprof/
> > >
> > > Hopefully someone will find it useful.
> >
> > "Indeed, a clean build of DMD itself (about 170’000 lines of D and 120’000 lines of C/C++) takes no longer than 4 seconds to build on a rather average developer machine."
> >
> > ...what!? DMD takes me... (compiling) ... 1 minute 40 seconds to build! And because DMD does all-files-at-once compilation, rather than separate compilation for each source file, whenever you change just one line in one file, you incur that entire build time, every time, because it can't just rebuild the one source file that changed. You also can't do multi-processor builds with all-in-one build strategies.
> >
> > 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.
>
> Also, in my experience, DMD seems to build a LOT slower now that it's in D than it used to when it was C++.

Oh, and also, nice work Vladimir! This is awesome! :)

November 08, 2018
On Thursday, 8 November 2018 at 04:16:44 UTC, Manu wrote:
> ...what!? DMD takes me... (compiling) ... 1 minute 40 seconds to build! And because DMD does all-files-at-once compilation, rather than separate compilation for each source file, whenever you change just one line in one file, you incur that entire build time, every time, because it can't just rebuild the one source file that changed. You also can't do multi-processor builds with all-in-one build strategies.
>
> 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.

It was definitely about 4 seconds not too long ago, a few years at most.

It does seem to take more time now; I wonder why.

November 08, 2018
On Thursday, 8 November 2018 at 04:16:44 UTC, Manu wrote:
> On Tue, Nov 6, 2018 at 10:05 AM Vladimir Panteleev via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>> [...]
>
> "Indeed, a clean build of DMD itself (about 170’000 lines of D and 120’000 lines of C/C++) takes no longer than 4 seconds to build on a rather average developer machine."
>
> ...what!? DMD takes me... (compiling) ... 1 minute 40 seconds to build! And because DMD does all-files-at-once compilation, rather than separate compilation for each source file, whenever you change just one line in one file, you incur that entire build time, every time, because it can't just rebuild the one source file that changed. You also can't do multi-processor builds with all-in-one build strategies.
>
> 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.

It sounds like you're not using "a rather average developer machine" then, as there's no way DMD should be that slow to build on a core i5 or better:

https://forum.dlang.org/post/rqukhkpxcvgiefrdcvdq@forum.dlang.org
November 08, 2018
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.

November 07, 2018
On Wed, Nov 7, 2018 at 10:10 PM Vladimir Panteleev via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>
> On Thursday, 8 November 2018 at 04:16:44 UTC, Manu wrote:
> > ...what!? DMD takes me... (compiling) ... 1 minute 40 seconds to build! And because DMD does all-files-at-once compilation, rather than separate compilation for each source file, whenever you change just one line in one file, you incur that entire build time, every time, because it can't just rebuild the one source file that changed. You also can't do multi-processor builds with all-in-one build strategies.
> >
> > 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.
>
> It was definitely about 4 seconds not too long ago, a few years at most.
>
> It does seem to take more time now; I wonder why.

100 seconds is a lot more than 4... 25x even, that's a pretty big productivity decline ;)
November 07, 2018
On Wed, Nov 7, 2018 at 10:30 PM Joakim via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>
> On Thursday, 8 November 2018 at 04:16:44 UTC, Manu wrote:
> > On Tue, Nov 6, 2018 at 10:05 AM Vladimir Panteleev via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
> >> [...]
> >
> > "Indeed, a clean build of DMD itself (about 170’000 lines of D and 120’000 lines of C/C++) takes no longer than 4 seconds to build on a rather average developer machine."
> >
> > ...what!? DMD takes me... (compiling) ... 1 minute 40 seconds to build! And because DMD does all-files-at-once compilation, rather than separate compilation for each source file, whenever you change just one line in one file, you incur that entire build time, every time, because it can't just rebuild the one source file that changed. You also can't do multi-processor builds with all-in-one build strategies.
> >
> > 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.
>
> It sounds like you're not using "a rather average developer machine" then, as there's no way DMD should be that slow to build on a core i5 or better:
>
> https://forum.dlang.org/post/rqukhkpxcvgiefrdcvdq@forum.dlang.org

I'm on an i7 with 8 threads and plenty of ram... although threads are useless, since DMD only uses one ;)

November 08, 2018
On Thursday, 8 November 2018 at 07:41:58 UTC, Manu wrote:
> On Wed, Nov 7, 2018 at 10:30 PM Joakim via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>>
>> On Thursday, 8 November 2018 at 04:16:44 UTC, Manu wrote:
>> > On Tue, Nov 6, 2018 at 10:05 AM Vladimir Panteleev via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
>> >> [...]
>> >
>> > "Indeed, a clean build of DMD itself (about 170’000 lines of D and 120’000 lines of C/C++) takes no longer than 4 seconds to build on a rather average developer machine."
>> >
>> > ...what!? DMD takes me... (compiling) ... 1 minute 40 seconds to build! And because DMD does all-files-at-once compilation, rather than separate compilation for each source file, whenever you change just one line in one file, you incur that entire build time, every time, because it can't just rebuild the one source file that changed. You also can't do multi-processor builds with all-in-one build strategies.
>> >
>> > 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.
>>
>> It sounds like you're not using "a rather average developer machine" then, as there's no way DMD should be that slow to build on a core i5 or better:
>>
>> https://forum.dlang.org/post/rqukhkpxcvgiefrdcvdq@forum.dlang.org
>
> I'm on an i7 with 8 threads and plenty of ram... although threads are useless, since DMD only uses one ;)

Running Windows XP? ;) That does sound like Windows though, as I do remember being surprised how long dmd took to build on Win7 when I tried it 8-9 years back. I still don't think the toolchain should be _that_ much slower than linux though.

Btw, the extra cores are _not_ useless for the DMD backend, which has always used separate compilation, whether written in C++ or D.
November 07, 2018
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?