Is there a difference (re-optimization) between MSVC ++ 2008 and the PSDK compiler?

I just installed the Platform SDK for Windows Server 2008 and .NET 3.5 on my new system and tried to compile a project for WIN64 for the first time. The Unicode Release of this program, built for the 32-bit version (using an optimizing compiler from the now-unavailable Free Toolkit) is about 2.8 MB. Using the amd64 compiler from the latest PSDK, the program is over 5MB in size.

I am most interested in the size of the program, so everything is built with the / O 1 switch. I expected the program to get bigger when built for 64 bits, but not that much. The size is more consistent with the line from the Express version where (some) optimizations are not available.

Does the PSDK compiler and the MSVC 2008 Professional compiler generate programs of all sizes? Does the compiler in PSDK optimize in the same way or even generally?

Thank you for understanding.

Edit:

The program and all associated libraries are built using the same makefile.vc on the command line, so differences in compilation settings are unlikely. I basically just used another batch file to start a shell with the proper environment for 64 bit compilation.

Here are the dimensions for the application:

    VC ++ Toolkit 2003 32 bit cl.exe: 13.10.3052 for 80x86 2.916.352
    Platform SDK 32 bit cl.exe: 15.00.30729.01 for 80x86 2.881.536
    Platform SDK 64 bit cl.exe: 15.00.21022.08 for x64 5.138.432

So the 64-bit version is 78% bigger: - (

0


source to share


2 answers


The 64-bit binary will be larger than the 32-bit binary due to differences in code side, static data, etc. Our project comes with 7.1 MB (x86) versus 10.7 MB (x64), and that's for a significant amount of code. Almost doubling sounds overkill unless you have a lot of static data with a pointer.



Make sure you reference / OPT: REF to reverse any unreferenced characters.

+1


source


I highly doubt this is an optimizer. The difference in program size is probably related to the inclusion of debug information and / or static libraries. Make sure you don't link with any static libraries you don't need.



0


source







All Articles