加快与SSD的编译时间 [英] Speed up compile time with SSD

查看:273
本文介绍了加快与SSD的编译时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想尝试加快我的C ++项目的编译时间。他们有大约3M行代码。

I want to try to speed up my compile-time of our C++ projects. They have about 3M lines of code.

当然,我不需要总是编译每个项目,但有时有很多源文件被其他人修改,我需要重新编译所有文件(例如,当有人更新 ASN.1 源文件时)。

Of course, I don't need to always compile every project, but sometimes there are lot of source files modified by others, and I need to recompile all of them (for example, when someone updates an ASN.1 source file).

我测量到编译一个中间项目(不涉及所有的源文件)大约需要三分钟。我知道这不是太多,但有时它真的无聊等待编译..

I've measured that compiling a mid-project (that does not involves all the source files) takes about three minutes. I know that's not too much, but sometimes it's really boring waiting for a compile..

我试图将源代码移动到SSD(旧的OCZ顶点3 60 GB),基准测试,它比HDD快5到60倍(特别是在随机读/写)。无论如何,编译时几乎是一样的(也许2-3秒更快,但它应该是一个机会)。

I've tried to move the source code to an SSD (an old OCZ Vertex 3 60 GB) that, benchmarked, it's from 5 to 60 times faster than the HDD (especially in random reading/writing). Anyway, the compile-time is almost the same (maybe 2-3 seconds faster, but it should be a chance).

也许将Visual Studio bin移动到SSD授予额外的性能增量?

Maybe moving the Visual Studio bin to SSD would grant additional increment in performance?

只是为了完成这个问题:我有一个W3520 Xeon @ 2.67 GHz和12 GB的DDR3 ECC。

Just to complete the question: I've a W3520 Xeon @2.67 GHz and 12 GB of DDR3 ECC.

推荐答案

C ++编译/链接受处理速度的限制,而不是HDD I / O。这就是为什么你没有看到任何增加的编译速度。
(将编译器/链接器二进制文件移动到SSD将不会执行任何操作)当编译一个大项目时,编译器/链接器和必要的库将被读入内存一次,并保持在那里。)

C++ compilation/linking is limited by processing speed, not HDD I/O. That's why you're not seeing any increase in compilation speed. (Moving the compiler/linker binaries to the SSD will do nothing. When you compile a big project, the compiler/linker and the necessary library are read into memory once and stay there.)

在编译C项目时(这比使用模板等的C ++项目花费的时间少得多),我已经看到一些小的加速,从工作目录移动到SSD或ramdisk,但不是足以让它值得。

I have seen some minor speedups from moving the working directory to an SSD or ramdisk when compiling C projects (which is a lot less time consuming than C++ projects that make heavy use of templates etc), but not enough to make it worth it.

这篇关于加快与SSD的编译时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆