Improving Visual Studio Performance: Additional Tips
November 1st, 2007I have seen a few blog entries related to boosting performance while using Visual Studio recently. The newest entry is by Scott Guthrie. He makes a similar point so what I suggested last year. The hard drive speed is very important. However, I would like to point out some additional details to augment what Scott is suggesting.
Disk Speed and Cache Size
As Scott points out laptops typically have 5400rpm speed hard drives, even the high end laptops. This is slow so Scott suggests upgrading to a 7200rpm speed drive. That is a good start, but you should also keep an eye on the cache size. Older drives have 1mb or 2mb of cache. Now you can get drives with 8mb and 16mb caches which will speed up the performance of the drive. The difference is like moving to a new apartment using a Honda Civic versus a large moving truck. Carrying larger loads with each trip will obviously cut down on the number of expensive trips.
External Drives and FireWire
I use external drive enclosures that you can get for around $40. They are empty shells that hold standard hard drives. You can choose from USB, FireWire or combination enclosures to connect them to your computer. I like the flexibility this provides. If you have the option, use the FireWire connection because it is designed for sustaining high data transfers over time. That will be important if you are watching media off the disk, running a long database query or running virtual machines. (FireWire vs USB: 1, 2)
The question of performance over a USB or FireWire connection versus an internal drive is something I have not researched. My theory is that I/O delays are significantly greater while physically spinning the disk to position the head to read and write data versus any delays from communicating over USB or FireWire because there are no moving parts over the wire. With the bottleneck being the drive itself, and not the link to it, I have leaned toward making sure I use the fastest drive available.
Defragging
Over time you will notice your computer gets slower. The most likely cause is disk fragmentation which is accelerated on a developer's machine due to the frequent file creation and disk writes. It is best to schedule regular defragging. On each computer I use I create a file called defrag.cmd and schedule it to run a few times during the week when I will not be using the computer. And I do it for every drive on the computer. Typically I have a drive for the operating system, C: and another for the data, D:. The script simply contains the following command.
defrag C:
The one catch is that you need to ensure you have enough space for the defragging process to work. Run the command occasionally to ensure you do have enough space. At the end of the script put a pause command to help you see any error or warning messages from running the script. And when you run this on Vista, you will need to right-click on the script and run it as the Administrator.
USB Flash Drives
The other question in my mind is what if I used a USB Flash Drive instead of a traditional hard drive to hold my development projects. I know a developer who does this so he can take his work home every night. I tried to find the disk speeds to compare a traditional drive to a flash drive but did not see anything that pointed out the difference clearly. I will have to run a benchmark later and post the results. I tend to think the USB Flash Drive would perform very well because it has no moving parts. To test this properly I need to ensure I get a high speed flash drive and not a cheaper drive with a slower access speed. I find this option appealing. Unfortunately Virtual PC does not show USB devices which means this will not be an option. But at least I could use SyncToy
to quickly keep a thumb drive up to date with files in my Virtual PC.
Ultimately it would be great to use a lightweight version of Visual Studio that can run a functional development environment from a thumb drive. If they can get the .NET runtime to be so small for the MacOS X installation I gotta believe that something similar could be done to get Visual Studio to run on a 2GB or 4GB flash drive. Imagine not having to wait through another Visual Studio installation that lasts hours. Instead you just order a flash drive from Microsoft with all of the development tools you would ever want on a simple thumb drive. Perhaps the Visual Studio team could add this idea to their To Do list for VS2010.

November 1st, 2007 at 3:41 pm
What brand of flash drive do you recommend? And what should be the speed? What are different speeds available?
November 1st, 2007 at 3:44 pm
I have a Acer Ferrari laptop with 2 GB of RAM. Any recommendations on SSD?
November 1st, 2007 at 4:11 pm
I do not have a brand that I would recommend, but I would suggest getting one that has a secure cap that you cannot lose easily. The Cruzer Micro has a cap that you can easily lose. I try to protect the metal connector from contact with my car keys in my pocket and any static charge when I am walking around with it.
http://www.tigerdirect.com/applications/SearchTools/item-details.asp?EdpNo=1024507&Sku=S153-3002
You can see the A-Data is all connected when it is closed or open.
http://www.tigerdirect.com/applications/SearchTools/item-details.asp?EdpNo=2224131&Sku=A208-1074
This other one from SanDisk is not bad and it is 8GB.
http://www.tigerdirect.com/applications/SearchTools/item-details.asp?EdpNo=3283217&Sku=S153-3264
It seems all of the ones being sold now are USB 2.0 drives, but make sure you get one if you want the best possible speed. There are so many to choose from and I have used several different kinds on Windows XP, Vista and MacOS X but I have not really noticed any difference among any of them. I connect the drives to the computer and it always comes up to browse as I expect. But be careful about any places where they do not allow USB drives. They may have the USB ports disabled for external storage and the thumbdrives will not work. Otherwise every brand I have used has worked as they are supposed to and all have been fast enough for my needs.
November 1st, 2007 at 5:00 pm
I found a good deal on a flash drive with fast read/write: http://www.newegg.com/Product/Product.aspx?Item=N82E16820227263
It looks like some of these flash drives are almost as fast as a SSD
November 2nd, 2007 at 9:44 am
http://www.memorysuppliers.com/customshapes.html
You can also order custom USB flash drives. I just found this link and it has some pretty cool examples.
November 12th, 2007 at 3:02 pm
Published specs are usually misleading. Locate reviews that you feel you can trust. The Patriot brand of flash drives are one that gets a good review of approx 20 mb on both read and write. Most flash drives perform poorly on write. Many brands use high speed flash chips for the first part of the drive that typically gets benchmarked and slow speed flash for the remainder so watch out. Flash has low latency but poor transfer speed compared to hard drives. The best flash is 20 mb/sec while a good 7200 such as the Seagate 500 can do 80 mb/sec down to 40 mb/sec at the end of the drive. USB or FireWire limits drive transfer speed to 40 mb/sec at best and some USB controller chips lowers that even more.
The best external drive interface is e-Sata which runs at full Sata speed. Many laptops can be outfitted with e-Sata through an expansion card which coupled with a 3.5 inch sata external drive and enclosure will be less expensive and faster than an internal 7200 laptop drive and either will be faster than a USB stick.
http://storagereview.com is an expert place to find comprehensive reviews of hard drives.