Feel like a geek and get yourself Ema Personal Wiki for Android and Windows

09 July 2010

Speed up compilation time in Visual Studio


Speed up your compilation time with Visual Studio drastically with this tip, especially with large projects.

Working from memory is always faster than working from disk. It would be a huge improvement to use Solid State harddrives as much as possible, but those are still quite expensive.

I always thought that the bottleneck for my PC was the CPU. Until I started to use the Moo0 system monitor (see picture on the right), which has clearly shown me that in 100% of the cases where there is a bottleneck, it is the harddrive.

Since memoryusage was only 30% most of the time, I figured that I might use some of my memory as a RAM-disk and work from a virtual disk that exists in memory only. There is a free RAM-disk utility that can be downloaded from mydigitallife.info. It credits Microsoft, Gavotte and lyh728 for the software.

The disadvantage of a RAM-disk is that all your carefully crafted contents are deleted once you restart your PC.

I solved this by synchronizing the RAM-disk with the c# project directory on disk where the code resides. There is an excellent synchronization utility called SyncBack which has a free edition. I told it to synchronize every 15 minutes, so I will lose fifteen minutes work at most. In most cases it only takes seconds to synchronize the changes, so I could synchronize more frequently.



All of the code and a few of the required dll's are now served from memory. This really sped up my compilation time. Are there more usages of this mechanism? The browser cache on RAM-disk? Outlook PST files? SQL server data files? How much more memory can my PC have...? How much does it cost...?