Visual Studio 2010 C++ linker performance for large projects

纵然是瞬间 提交于 2019-12-22 11:39:48

问题


At my company we're still using Visual Studio 2005, but are peeking at Visual Studio 2010 in the hope that it will speed up some parts of our development cycle. At the moment we're most interested in the performance of the C++ linker of Visual Studio 2010. When building our application, we're looking at link times between 40 seconds and 2 minutes, depending on machine configuration (SSD vs HDD) and if stuff is already in Windows' disk cache. A simple test where we use the VS2010 linker instead of the VS2005 linker showed an improvement of about 25%. We were hoping to see a much much bigger improvement because we thought that the linker would now be able to make use of multiple cores.

Is this 25% really the improvement that we should expect when switching to VS2010, or are there some magic linker switches that reduce link times to acceptable levels?


回答1:


My understanding is that the big change (performance wise) that MS made to the linker in VS2010 is that writing the .pdb file is done on a separate thread. Of course, since the linker does much more than this, there's a limit to how much it'll improve the overall link time:

  • Linker throughput

And here's an article that shows how you can get some more detailed timing statistics if you're interested in that analysis:

  • VC++ Tip: Get detailed build throughput diagnostics using MSBuild, compiler and linker

Anyway, a 25% improvement in speed by just dropping in a new set of tools seems to be a pretty good result to me.




回答2:


25% less time is not bad. If you want faster linking times try dynamic linking with DLLs as opposed to linking with static libraries. This is often way faster.



来源:https://stackoverflow.com/questions/3512864/visual-studio-2010-c-linker-performance-for-large-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!