为什么我的 Visual C++ 2008 x64 构建比 x86 构建慢 5 倍?
我一直在努力缩短产品的构建时间。我们正在使用持续集成,我们的构建现在需要 2 小时才能运行。
我查看了 NANT 计时,发现很多地方都比应有的速度慢,但其中一个突出的地方是我们 Visual C++ 项目的 x64 版本。以下是与相同代码的 x86 版本相比的计时示例:
Release Win32: 8' 49" 发布 x64:41' 8"
x64 大约慢 5 倍。同样,这是针对完全相同的代码。
是否有其他人经历过 x86 和 x64 之间的这种构建时间差异?有任何缩小差距的建议吗?
注意:我知道提高整体构建性能的工具,例如 Xoreax 分布式构建和 TeamCity 并发构建,我也将研究这两个工具,但我忍不住觉得应该有某种方法让 x64 构建恢复正常无需借助第三方工具。
I've been trying to improve the build times for my product. We're using continuous integration, and our builds are now taking 2 hours to run.
I've looked at the NANT timings and see alot of places that are slower than they should be, but one that jumps out is the x64 builds of our Visual C++ projects. Here's an example of the timings compared to x86 builds of the same code:
Release Win32: 8' 49"
Release x64: 41' 8"
x64 is about 5x slower. Again, this is for the exact same code.
Has anyone else experienced this sort of build time disparity between x86 and x64? Any suggestions for closing the gap?
NOTE: I am aware of tools to improve build performance overall, like Xoreax distributed builds and TeamCity concurrent builds, and I'm going to investigate both of those as well, but I can't help but feel there should be some way to get x64 builds back in line without resorting to third party tools.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查两者的项目构建设置是否相同。当您选择 x64 时,VS 基本上会加载新的项目设置,并且它们可能非常不同。例如,检查 x64 中是否启用了增量构建。
Check if the project build settings are the same for both. When you select x64, VS basically loads new project settings and they can be very well quite different. For example check if incremental building is enabled in x64.
我不知道,但如果整个代码生成器是针对 x64 重写的,我不会感到惊讶。如果您进行测试构建并使用进程资源管理器查看编译器引入的 DLL,您将能够查看编译器在为两个不同目标构建时是否使用完全不同的二进制文件。您可能会发现 x64 后端是托管的 .NET 应用程序,而 x86 后端是老式本机应用程序。只是一个猜测。可能不是真的。当进程资源管理器运行时,您可以调查两者的 CPU/磁盘/RAM 使用情况。
I don't know, but I wouldn't be surprised if the entire code generator was re-written for x64. If you do a test build and use process explorer to look at the DLLs that the compiler pulls in, you'll be able to see if the compiler is using entirely different binaries when building for the two different targets. You might find that the x64 back-end is a managed .NET app, while the x86 one is old school native. Just a guess. Probably not true. You could investigate the CPU/disk/RAM usage of the two while you've got process explorer running.