ufukgun
ufukgun

Reputation: 7209

Release build time takes so long in VS2008

When i build the project, build time get so much time if it is release.

in release, linking time is : 130secs

in debug, linking time is : 15secs for the same project.

there is no difference in compiling, but linking there is a huge difference.

do you know why it could be?

Upvotes: 1

Views: 1141

Answers (3)

JaredPar
JaredPar

Reputation: 755041

The only thing I could think of off the top of my head is that you have FxCop set to run in Release mode only. This would cause a significant build time difference on a large project since FxCop runs as part of the build process if enabled.

Can you give us some more information about your solution? For instance

  • What language?
  • What type of project?
  • Number of files in project?
  • Does it repro from the command line?

Upvotes: 0

Sebastiaan M
Sebastiaan M

Reputation: 5885

My experience is that during linking most of time is spent generating debug info. If you try to link without debug info, the link time should go way down (the project I'm working on goes from about 80 seconds to about 10). If not, it's something else. In debug builds long link times can also be caused by incorrect incremental linking; I saw link times go up from 1 minute to 5 minutes. If you want to decrease link time while still keeping debug info, make sure you have as few compile units as possible, since the debug info of all compile units has to be merged. I do that by combining multiple cpp files into one compile unit by having one cpp file include those cpp files.

Regards,

Sebastiaan

Upvotes: 0

1800 INFORMATION
1800 INFORMATION

Reputation: 135335

Release build is probably slower because of optimisation settings. Typically for a debug build, you don't have optimisation set - this means the generated object files are probably more or less copied straight into the output. On the other hand, for release builds, you may have LTCG turned on or other linker optimisations may apply. Linking is normally CPU bound, and normally only runs in a single thread so it tends to be kind of slow. The bigger the output, the worse this seems to get also.

Upvotes: 3

Related Questions