Windows 7 uses the hard disk to fetch application data and documents as well as to store data in the page file...
temporarily. Therefore, optimizing your hard disk can greatly improve Windows 7's overall performance, as described in the next few sections.
Examining Hard Drive Performance Specifications
If you're looking to add another drive to your system, your starting point should be the drive itself: specifically, its theoretical performance specifications. There are three things to consider: the hard drive speed, the size of the hard drive cache, and the hard drive seek time.
The Hard Drive Speed
The hard drive speed is a measure of how fast the drive's internal platters spin, measured in revolutions per minute (rpm). In general, the higher the rpm value, the better the drive's performance. Most hard drives spin at 7,200rpm, although some older drives spin at 5,400rpm. You should avoid these older drives because the performance hit is substantial, and they're not that much cheaper than the equivalent 7,200rpm drive. If money is no object, drives are available that spin at 10,000rpm, which offers a substantial performance boost.
The Hard Drive Cache
The hard drive cache refers to a RAM memory area embedded in the hard drive. This memory is used as a holding place for frequently used bits of data. If the CPU finds the data it needs in the hard drive cache, it saves time because it can load that data directly into memory instead of asking the hard drive to fetch it from the disk. The bigger the hard drive cache, the more data it can hold, so the more likely the CPU is to find the data it needs, and thus the better the overall performance of the hard drive.
Inexpensive hard drives usually come with just a 2MB cache, whereas most mainstream drives come with either an 8MB or a 16MB cache. Some high-end drives come with a whopping 32MB cache.
The Hard Drive Seek Time
There are four measures of hard disk read/write performance:
- Seek time -- The time it takes the hard drive's actuator arm to move the read/write head over the track that contains the sector that will be read or written to.
- Latency -- The time it takes the hard drive to rotate the disk so that the sector is directly under the read/write head (so this value is sometimes called the rotational latency).
- Write time -- The time it takes the writing mechanism on the read/write head to write data to the sector.
- Read time -- The time it takes the reading mechanism on the read/write head to read data from the sector.
In all cases, the lower the time, the faster the drive's performance.
Of these, the seek time is the most important—or, at least, it's the one that's most often quoted in hard drive ads and descriptions. The seek time is usually an average because sometimes the read/write head has to travel a relatively long distance along the arm and sometimes a relatively short distance. The seek time, similar to the latency, write, and read time, is measured in milliseconds. For a low-end drive, the average seek time is usually 12ms or higher; for a mainstream drive, the average seek time is usually around 10ms; and for a high-end drive, the average seek time is usually under 9ms. (For comparison, note that most of the 10,000rpm drives on the market now boast average seek times around 4.6ms, which is blazingly fast.)
Performing Hard Drive Maintenance
For an existing drive, optimization is the same as maintenance, so you should implement the maintenance plan I discuss in Chapter 7, "Maintaining Your Windows 7 System." For a hard disk, this means doing the following:
- Keeping an eye on the disk's free space to make sure that it doesn't get too low
- Periodically cleaning out any unnecessary files on the disk
- Uninstalling any programs or devices you no longer use
- Checking all partitions for errors frequently
- Defragmenting partitions on a regular schedule
Disabling Compression and Encryption
If you use NTFS on a partition, Windows 7 enables you to compress files to save space, as well as to encrypt files for security. (See "Converting FAT16 and FAT32 Partitions to NTFS" later in this chapter.) From a performance point of view, however, you shouldn't use compression and encryption on a partition if you don't have to. Both technologies slow down disk accesses because of the overhead involved in the compression/decompression and encryption/decryption processes.
Turning Off the Content Indexing
The Indexer is a Windows 7 background process that indexes the contents of a drive onthe- fly as you add or delete data. This greatly speeds up Windows 7's search features (including Instant Search) because Windows 7 knows the contents of each file. However, you should consider turning off content indexing to improve overall performance, particularly on any drive where you don't do much file searching. (You can still search based on file properties.) To do this, follow these steps:
- Select Start, Computer.
- Right-click the drive you want to work with and then click Properties. Windows 7 display's the drive's property sheet.
- On the General tab, deactivate the Allow Files on This Drive to Have Contents Indexed in Addition to File Properties check box.
- Click OK.
Enabling Write Caching
You should also make sure that your hard disk has write caching enabled. Write caching means that Windows 7 doesn't flush changed data to the disk until the system is idle, which improves performance. The downside of write caching is that a power outage or system crash means that the data never gets written, so the changes are lost. The chances of this happening are minimal, so I recommend leaving write caching enabled, which is the Windows 7 default. To make sure, follow these steps:
- Select Start, type device, and then click Device Manager in the search results.
- Open the Disk Drives branch.
- Double-click your hard disk to display its property sheet.
- In the Policies tab, make sure that the Enable Write Caching on the Device check box is activated.
- For maximum performance, activate the Turn Off Windows Write-Cache Buffer Flushing on the Device check box. (Note that this option is available only with certain hard drives that support it.)
- Click OK.
CAUTION: Activating the Turn Off Windows Write-Cache Buffer Flushing on the Device option tells Windows 7 to use an even more aggressive write-caching algorithm. However, an unscheduled power shutdown means you will almost certainly lose some data. Activate this option only if your system is running off an uninterruptible power supply (UPS).
Converting FAT16 and FAT32 Partitions to NTFS
The NTFS file system is your best choice if you want optimal hard disk performance because, in most cases, NTFS outperforms both FAT16 and FAT32. (This is particularly true with large partitions and with partitions that that have lots of files.) Note, however, that for best NTFS performance you should format a partition as NTFS and then add files to it. If this isn't possible, Windows 7 offers the CONVERT utility for converting a FAT16 or FAT32 drive to NTFS:
CONVERT volume /FS:NTFS [/V] [/CvtArea:filename] [/NoSecurity] [/X]
volume -- Specifies the drive letter (followed by a colon) or volume name you want to convert.
/FS:NTFS -- Specifies that the file system is to be converted to NTFS.
/V -- Uses verbose mode, which gives detailed information during the conversion.
/CvtArea:filename -- Specifies a contiguous placeholder file in the root directory that will be used to store the NTFS system files.
/NoSecurity -- Specifies that the default NTFS permissions are not to be applied to this volume. All the converted files and folders will be accessible by everyone.
/X -- Forces the volume to dismount first if it currently has open files.
For example, running the following command at the Command Prompt converts the D: drive to NTFS:
convert d: /FS:NTFS
In some cases, you may see the following message:
Convert cannot gain exclusive access to the D: drive, so it cannot convert it now. Would you like to schedule it to be converted the next time the system restarts?
In this case, press Y to schedule the conversion.
If you make the move to NTFS, either via formatting a partition during setup or by using the CONVERT utility, you can implement a couple of other tweaks to maximize NTFS performance. I cover these tweaks in the next two sections.
Turning Off 8.3 Filename Creation
To support legacy applications that don't understand long filenames, for each file, NTFS keeps track of a shorter name that conforms to the old 8.3 standard used by the original DOS file systems. The overhead involved in tracking two names for one file isn't much for a small number of files, but it can become onerous if a folder has a huge number of files (300,000 or more).
To disable the tracking of an 8.3 name for each file, enter the following statement at the Command Prompt:
fsutil behavior set disable8dot3 1
Note, too, that you can do the same thing by changing the value of the following Registry setting to 1. (Note that the default value is 2.)
The FSUTIL program requires Administrator account privileges. Click Start, type command, right-click Command Prompt in the search results, click Run as Administrator, and then enter your UAC credentials.
Disabling Last Access Timestamp
For each folder and file, NTFS stores an attribute called Last Access Time that tells you when the user last accessed the folder or file. If you have folders that contain a large number of files and if you use programs that frequently access those files, writing the Last Access Time data can slow down NTFS. To disable writing of the Last Access Time attribute, enter the following statement at the Command Prompt:
fsutil behavior set disablelastaccess 1
You can achieve the same effect by changing the value of the following Registry setting to 1 (although this now seems to be the default value in Windows 7):
Tuning Windows 7's performance
Windows 7 performance monitoring tools
Optimizing Windows 7 startup performance for energy efficiency
Optimizing Windows 7 application performance
Improving Windows 7 performance by optimizing the hard disk
Windows 7 virtual memory performance optimization
Printed with permission from Sams Publishing. Copyright 2009. Microsoft Windows 7 Unleashed by Paul McFedries. For more information about this title and other similar books, please visit www.pearson.com.