Reputation:
Using LTO in MSVC increased our build time considerably.
Before: Build Time (Release): 00:02:48.2022884
After: Build Time (Release): 00:04:50.1647716
Is there any way to reduce the total link time necessary in MSVC (or in general)?
Upvotes: 4
Views: 1494
Reputation: 41067
A lot of work has gone into improving overall linker performance the past few releases, so VS 2019 is a good upgrade for this.
For your 'local' development builds, /DEBUG:FASTLINK
can help by avoiding the need to coalesce all the pdbs into one. This doesn't help your overnight builds, but it make as a big difference in your iteration time.
In general the overall time to perform "Whole Program Optimization" / "Link-Time Code Generation" is going to scale by the size of the final EXE. If you have a 'large monolithic' EXE--I've seen some PC games get up into the 100MB+ range--it will take a lot longer than a smaller EXE with a few DLLs.
See:
Upvotes: 3