Simon Richter
Simon Richter

Reputation: 29618

Expected performance of MSVC link time code generation

I'm compiling the KiCad EDA suite, using MSVC 9 (15.0.30729.1).

This is a fairly complex piece of software, so a total compilation time of 3.5 hours for an /O2 Release build on an i3 is completely acceptable. To further optimize the code, I have enabled /GL and /LTCG to use the link time code generation feature.

Looking at the largest component: on x86, this slowed down the link process somewhat (as expected), but gave no reduction in code size (7.3 MB); on x64, a single linker invocation now takes 1.5 hours on its own, and still does not reduce code size (10.1 MB) in the slightest.

For comparison, gcc on x64 generates 11 MB without -flto, and 9.5 MB with -flto (taking 10 minutes for the linker step) -- while I'm aware that this MSVC version is significantly older, I'm certainly not used to gcc generating smaller code in less time than MSVC.

As my experience with the MSVC toolchain is superficial at best: is it typical for link-time code generation to not yield a reduction in code size? Is there a compiler option I might have missed?

Upvotes: 1

Views: 954

Answers (0)

Related Questions