How to accelerate the linking time?

Steven Schveighoffer schveiguy at gmail.com
Fri Jul 10 12:15:56 UTC 2020


On 7/10/20 1:45 AM, zoujiaqing wrote:
> zoujiaqing at osx:~/projects/hunt-skeleton (*)
>> time dub build                             master [fe3d6bc] modified
> Performing "debug" build using /Library/D/dmd/bin/dmd for x86_64.
> hunt 1.6.1: target for configuration "library" is up to date.
> hunt-extra 1.0.0: target for configuration "library" is up to date.
> hunt-net 0.5.1: building configuration "default"...
> hunt-time 1.1.1: building configuration "library"...
> hunt-proton 1.1.0-beta.3: building configuration "library"...
> hunt-amqp 1.1.0-beta.4: building configuration "library"...
> hunt-pool 1.1.1: building configuration "library"...
> hunt-amqp-client 1.1.0-beta.2: building configuration "library"...
> hunt-redis 1.2.0: building configuration "library"...
> hunt-cache 0.8.1: building configuration "default"...
> hunt-console 0.2.0: target for configuration "hunt-console" is up to date.
> hunt-sql 1.4.0: target for configuration "library" is up to date.
> hunt-database 2.1.0: building configuration "default"...
> hunt-validation 0.3.0: target for configuration "library" is up to date.
> hunt-entity 2.6.0: building configuration "library"...
> hunt-http 0.6.2: building configuration "default"...
> hunt-jwt 0.1.0-beta.1: target for configuration "library" is up to date.
> hunt-security 0.4.0: target for configuration "library" is up to date.
> hunt-shiro 1.1.3: building configuration "library"...
> poodinis 8.1.0-beta.2: target for configuration "library" is up to date.
> hunt-framework 3.2.0: building configuration "library"...
> hunt-skeleton 3.1.0+commit.4.gfe3d6bc: building configuration 
> "application"...
> Linking...
> To force a rebuild of up-to-date targets, run again with --force.
> dub build  96.60s user 14.75s system 94% cpu 1:57.62 total
> 
> 
> My laptop is MacBook Pro 15, but linking time so long.

The linking time is high because of the symbol count/sizes generally. 
Lots of templates means the linker takes a while to sort through the 
mess you made ;)

I have the same problem on vibe.d projects.

typically for me, the compilation step takes at least 50% of the time 
(hard to tell, as dub does not output the timestamp at that point).

-Steve


More information about the Digitalmars-d mailing list