Profiling DMD's Compilation Time with dmdprof

Rainer Schuetze r.sagitario at gmx.de
Fri Nov 9 07:32:43 UTC 2018



On 09/11/2018 00:12, kinke wrote:
> 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
> 

Similar numbers for me too. Please note that the auto-tester shows
similar values for release builds on all platforms, so I suspect very
low numbers reported here are debug build timings.

> DMD's `-inline` is known to be *slow*.

Pedantically, it's not the inliner by itself, but the optimizer that
cannot cope with large functions. With some improved inlining
capabilities that got worse over time.

Visual Studio only provides parallel compilation of projects out of the
box, you have to add it yourself for your favorite language for
parallelization within a project. Igor has done that for the msbuild
integration of dmd and LDC (https://github.com/dlang/visuald/pull/94),
but the PR has kind of stalled due to some undesirable side effects.

Unfortunately, single file compilation is pretty slow, so there is not
so much gain from switching from building per package to single file
parallel compilation unless you have many cores.


More information about the Digitalmars-d-announce mailing list