Linking is the slowest part of D's compilation process– can we use mold to speed it up?

Max Haughton maxhaton at gmail.com
Fri Feb 26 17:20:13 UTC 2021


On Friday, 26 February 2021 at 17:04:26 UTC, deadalnix wrote:
> On Friday, 26 February 2021 at 13:23:06 UTC, Atila Neves wrote:
>> Nice. I wrote a D program once that used the linker as a 
>> server and kept "sending" it object files that it kept on 
>> relinking, but unfortunately that didn't speed anything up.
>
> I wouldn't expect this to improve performance unless the linker 
> is coded to take advantage of this. Re linking everything many 
> times won't help.

On the subject of re-linking, reducing pressure on the linker is 
probably the way to go from the perspective of things we can 
actually do. The issue is that these things end up being deeply 
buried in code or worse exhibit slightly chaotic behaviour (For 
example, if you pull in dmd-as-a-library in dub it rebuilds the 
entire frontend every time for no reason as far as I can tell, 
and it's hard to know why)


More information about the Digitalmars-d mailing list