Speed up compilation in Visual D

Rainer Schuetze r.sagitario at gmx.de
Wed Apr 24 05:34:10 UTC 2019



On 23/04/2019 18:03, Alex wrote:
> On Tuesday, 23 April 2019 at 07:03:36 UTC, Rainer Schuetze wrote:
>>
>>
>> On 23/04/2019 02:50, Alex wrote:
>>> Is there any way to speed of compilation in Visual D? Seems
>>> everything is being recompiled from scratch even with minute changes.
>>> I'd think compiling to object files might help but maybe not?
>>
>> With visualdproj project files, you can select between building all at
>> once (which would cause what you describe unless you separate your
>> code into multiple libraries) and single file compilation which will
>> only recompile what (transitively) imports the file with the changes,
>> but that's often only faster if there are only few files to update.
> 
> How do I enable this? There are probably 10 thousand files and I
> updating just a few.
> 
> I tried some of the different compilation options[combined compile and
> link and separate compile and link] and they all took about the same
> time except with separate compile I'd get the warning:
> 
> x64\Debug DMD\_.obj : warning LNK4042: object specified more than once;
> extras ignored
> 
> x4

I guess you have multiple file _.d in different directories? You should
enable "keep path from source" on the output page so these are not
written to the same object files.

"combined" and "separate" compile and link only have subtle differences
that won't have an effect on large projects. "combined" will try to let
dmd also do the link in the same invocation, but that is often
prohibited by other options.

You might want to try "single file compilation" with "keep path from
source" instead.

> 
>> The vcproj projects can compile per package, i.e. there is some kind
>> of automatic separation into libraries. In addition, the latest
>> version allows you to enable parallel compilation on multiple cores.
> 
> Is there a way to move a visualdproj to a vcproj?

Unfortunately, no. You can include all files from a directory
recursively, as used by dmd
(https://github.com/dlang/dmd/blob/master/src/vcbuild/dmd.vcxproj#L214),
but it won't recreate the folder structure in the project. VC projects
also don't let you drop directories into the solution, so folders have
to be created manually.

> 
> What it sounds like is that you are saying vcproj is better?

It's probably the future, but there are a couple of features that
haven't made it to the msbuild based projects, e.g. OMF support, private
phobos build.


More information about the Digitalmars-d-ide mailing list