Using a RAM drive to compile Visual Studio .NET projects

Posted in .NET 2.0 | Performance | Productivity | Visual Studio 2005 | RAM disk at Saturday, 15 December 2007 10:18 GMT Standard Time
(updated 22 dec 07)

After reading some blog posts like this I decide to test on my computers how important is hard disk speed in order to increase your productivity when compiling Visual Studio solutions with more than a few project.

I also wanted to see the gain if I placed my solution (more than 25 projects) in a RAM drive disk instead of the hard disk (be sure you backup frecuently if you do that, or get one of this things to avoid data lost).

In order to create a RAM drive, I download the trial version of Virtual Hard Drive Pro
 from FarStone.

There are the results:

1. Environment hardware information

My desktop:
  1. CPU: AMD Sempron, 1800 MHz
  2. RAM: 2 x (1 Gb Kingston)
  3. Hard disks (2):
    1. System: ATA-100 40 Gb Barracuda 7200 rpm. Average seek: 8.5 ms. Buffer size: 2Mb. Average read speed: 40 Mb/second (*).
    2. Data and code: SATA 200 Gb Barracuda 7200 rpm. Average seek: 8.5 ms. Buffer size: 8 Mb. Average read speed: 50 Mb/second (*).
  4. RAM drive speed (read): 900 Mb/sec
My laptop (Toshiba Satellite Pro M70):
  1. CPU: Intel Pentium Celeron 1.73 Ghz
  2. RAM: 2 x (512 Mb Toshiba)
  3. Hard disk (1) : Toshiba 5400 rpm. Average read speed: 30 Mb/second (*)
  4. RAM drive speed (read): 1500 Mb/sec
* (Hard disk speed tests have been done with HD_Speed from www.steelbytes.com)

2. The Microsoft Visual Studio solution

A Microsoft Visual Studio .NET 2005 solution with 26 projects (Windows Forms and Windows library projects mainly), in C#.

3. Results

Compilation:

Desktop machine:

a) Compilation on hard disk (no RAM Drive installed yet): 72 seconds*
b) Compilation on a 500 MB RAM Drive : 71 seconds*

Laptop machine:

a) Compilation on hard disk (no RAM Drive installed yet): 65 seconds*
b) Compilation on a 400 MB RAM Drive : 32 seconds*

*(average of three compilations)

4. Conclusions:

Seems like my desktop doesn't have much processor power, and the bottleneck is mainly on the CPU, since there is not much different results on readig from a 50 Mb/seconds hard disk or from a 900 MB/second one (the RAM Drive)

My laptop, instead has a slower disk drive but more processor power, so there is a lot of difference between compiling from hard disk and RAM drive. (it took half the time on the RAM disk - also RAM disk read speed is higher than in the desktop)

I still will do more tests with some other combinations of CPU and hard disk..

Feel free to do the above tests yourself and share the results.

Updated:
  • 22 dic 07: Added test with laptop. Desktop tests done again.

AddThis Social Bookmark Button

Tuesday, 15 April 2008 07:07:40 (GMT Daylight Time, UTC+01:00)
I've got a much larger C++ project, which takes about an hour to compile on a typical dual core machine and SATA drives. I tried a 4.7GB RAM drive under 64-bit Vista, and so far I'm not impressed. The entire source code is about 2GB, and expands to about 4.3GB when built (object files, .libs, etc). I'm new to 64-bit and Vista, so I don't know if it's a configuration problem on my end. I'm trying both SuperSpeed Ram Drive and QSoft RamDrive. During the build, there still seems to be a lot of hard drive activity. I wish I could lock my C: drive during the build, to prevent Vista from doing anything else during the compile. I assume Visual Studio is creaing bunches of "scratch files" as it goes through the stages of compilation.
Any suggestions here?
voidstar
Tuesday, 15 April 2008 08:33:55 (GMT Daylight Time, UTC+01:00)
I would try to buy the largest ammount of RAM your machine can support (I am sure you already thought about this) and a "really" fast hard disk (10k rpm with low latency, like the Raptor WD1500AHFD). I would also try to disable the SO SWAP file (you can do that if you have enough RAM).

You can also go for a Intel Quad CPU. Visual Studio 2008 has improved a lot build times when usin a multi-core CPU.

Hope it helps, let me know how it went!

ivan
Wednesday, 22 October 2008 10:35:46 (GMT Daylight Time, UTC+01:00)
Visual Studio uses the TEMP dir a lot while compiling, so that's why you still see activity on your c:\ drive.
Try pointing your TMP and TEMP environment variables at the ramdrive
Izno
Sunday, 09 November 2008 19:08:37 (GMT Standard Time, UTC+00:00)
Interesting tip Izno! Thanks!
Monday, 27 July 2009 19:18:38 (GMT Daylight Time, UTC+01:00)
The code I'm currently working on has over 1.5M lines of C++ source in 38 projects. I have 24 GB of RAM, and 8 cores, and a full rebuild takes about 40 minutes. The two biggest speed gains I've made in the past are using precompiled headers CORRECTLY. This project doesn't yet. The other big gain I've made is to use RAID 0 for swap, temp, and source directories. This computer has 4 drives. The first is the boot drive, the second is general storage, and the last two are the RAIDed work drives.
2knarf
Comments are closed.