msbuild 比 devenv 慢
当从命令行使用 devenv 或 msbuild 构建 VS2008 解决方案文件时,我遇到了构建持续时间方面的性能不一致问题。
我的解决方案包含 C# 和 C++ 项目,我得到以下结果:
devenv.exe(命令行或 ide 内):7 分钟 msbuild.exe:14 分钟
我尝试调整 msbuild 开关传递 /maxcpucount 和 /p:VCBuildAdditionalOptions=m# 但到目前为止没有运气。
有什么想法吗?
I'm experiencing performance inconsistencies with regards to build duration when building a VS2008 solution file with either devenv or msbuild from command line.
My solution contains both C# and C++ projects, and I have these results:
devenv.exe (either command line or within the ide): 7 minutes
msbuild.exe: 14 minutes
I tried tuning the msbuild switches passing /maxcpucount and /p:VCBuildAdditionalOptions=m# but with no luck so far.
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MSBuild 在 VC 项目上可能会比较慢。它做了一些体操来构建它们,因为它们不是 MSBuild 格式,并且无法获得太多并行性。相反,如果您需要性能,请尝试在命令行上运行 VS - devenv.exe /build。或者,升级到 VS2010,因为 VC 项目是由 MSBuild 原生构建的,您将恢复性能。它通常比 VS 更快。
当然,获得构建速度的杀手级方法是仅构建已更改的内容,并依赖增量构建。大多数时候,大多数开发人员应该进行快速增量构建。
担
MSBuild can be slower on VC projects. It does some gymnastics to build them, because they're not MSBuild format, and can't get much parallelism. Instead, try running VS on the command line- devenv.exe /build - if you need the performance. Or, upgrade to VS2010, because VC projects are natively built by MSBuild and you will get your performance back. It will typially be faster than VS.
Of course, the killer way to get build speed is to build only what has changed, and rely on incremental build. Most of the time, most developers should be doing quick incremental builds.
Dan
您正在运行的完整 msbuild 命令是什么?
顺便说一句,您是否将构建输出调低为“安静”或“最小”?这会稍微减少构建时间...
在 IDE 中构建只需 7 分钟!就我个人而言,我会发疯,调试一定是一场噩梦:-|
what is the full msbuild command you are running?
As a side point, have you got the build output turned down to Quiet or Minimal? That reduces build time a little...
7 minutes to build in the IDE!! Personally I'd go insane, debugging must be a nightmare :-|