views:

316

answers:

3

Hi, 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?

+2  A: 

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.

1800 INFORMATION
+1 except for the comment "Linking is normally CPU bound". Often, linking is disk I/O bound.
Adrian McCarthy
A: 

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

Sebastiaan Megens
A: 

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?
JaredPar
- it is a c++ project- in this project i use openSceneGraph and qt together.- there are more than 200 files- qt files are reproducing on compile. in linking there is no repro.
ufukgun