Re: P.S. Why would release static lib be significantly larger then my debug build?
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Sat, 13 Jan 2007 07:26:25 -0800
nospam wrote:
Carl Daniel [VC++ MVP] wrote:
[ explanation of large library size snipped ]
I did notice that in another DLL project, the DLL size is fairly small
even though the huge library of the first project is included in the
DLL.
What is best if I really do not care about size? Should I have /GL
and /LTCG declared?
If you care about finished DLL/EXE size, then using /GL and /LTCG is the way
to go. The only downside - it substantially increases link time, but in
exchange, can result in up to 30% smaller code in real-world cases (much
more in artifically constructed cases). The link-time code generation can
do cross-module inlining which simply isn't possible when compiling one
module at a time. Also, if you're using Visual Studio Professional or
above, /GL is the stepping stone to profile-guided optimization, which can
sometimes yield up to another 30% improvement (again, even more in some
scenarios).
Is there some place that tells me where the compiler / linker switches
can be found in the corresponding GUI settings in Visual Studios?
Wouldn't that be nice! I've never seen such a reference, but it might be
out there somewhere. The fall back is to use the "Command line" portion of
the project properties dialog to observe the effect of changing some IDE
setting. In most cases, if you compare the description of the setting in
the IDE with the help text the command-line compiler provides (cl /? at a
command prompt), you'll be able to figure out the mapping.
-cd
.
- References:
- Why would release static lib be significantly larger then my debug build?
- From: nospam
- P.S. Why would release static lib be significantly larger then my debug build?
- From: nospam
- Re: P.S. Why would release static lib be significantly larger then my debug build?
- From: Carl Daniel [VC++ MVP]
- Re: P.S. Why would release static lib be significantly larger then my debug build?
- From: nospam
- Why would release static lib be significantly larger then my debug build?
- Prev by Date: Re: P.S. Why would release static lib be significantly larger then my debug build?
- Next by Date: Re: P.S. Why would release static lib be significantly larger then my debug build?
- Previous by thread: Re: P.S. Why would release static lib be significantly larger then my debug build?
- Next by thread: Re: P.S. Why would release static lib be significantly larger then my debug build?
- Index(es):
Relevant Pages
|