Practical parallelization of D compilation

kinke kinke at gmx.net
Wed Jan 8 13:14:38 UTC 2020


On Wednesday, 8 January 2020 at 04:40:02 UTC, Guillaume Lathoud 
wrote:
>  * first run (compiling everything): 50% to 100% slower than
>    classical compilation, depending on the hardware, resp. on 
> an old
>    4-core or a more recent 8-core.

If parallel compiler invocations for each source file are indeed 
that much slower than a single serial all-at-once compilation in 
your case, you can also try to compile all modules at once, but 
output separate object files - `ldc2 -c a.d b.d c.d`.

> I wonder if some heuristic roughly along these lines - when 
> enough source files and enough cores, do parallel and/or re-use 
> - could be integrated into the compilers, at least in the form 
> of an option.

I think that's something to be handled by a higher-level build 
system, not the compiler itself.


More information about the Digitalmars-d-learn mailing list