Windows 7 / Getting Started

Enable automatic boot defragments

Here's a funny little setting in the Registry that seems as though it's supposed to instruct Windows to defragment your hard disk automatically each time it starts:

  1. Open the Registry Editor.
  2. Expand the branches to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction.
  3. Double-click the Enable value, and type Y for its data (or type N to disable it).

The funny part is that this setting is probably already enabled on your system (it's enabled by default on most Windows 7 systems). Now, have you ever seen Windows run Disk Defragmenter at startup?

The reason you don't see it is because it isn't a full defragment. Instead, it's only a boot defragment, which affects only the files registered with Windows' Prefetch feature (see the upcoming sidebar "Keeping an Eye on Prefetch") and listed in the Layout.ini file (not a standard .ini file).

You can perform this boot defragment at any time by running the commandline Defrag tool with the undocumented /b option, like this: defrag c: /b.

Keeping an Eye on Prefetch

Prefetch is a feature (first introduced in Vista) that stores specific data about the applications you run in order to help them start faster. Prefetch is an algorithm that helps anticipate cache misses (times when Windows requests data that isn't stored in the disk cache), and stores that data on the hard disk for easy retrieval.

This data is located in \Windows\Prefetch, and, as the theory goes, periodically clearing out the data in this folder (say, once a month) will improve performance. As new applications are subsequently started, new Prefetch data will be created, which may mean slightly reduced performance at first. But with older entries gone, there will be less data to parse, and Windows should be able to locate the data it needs more quickly. Any performance gains you may see will be minor (if you see any at all), but those users wishing to squeeze every last CPU cycle out of their computers will want to try this one.

Note that deleting Prefetch data may increase boot time slightly, but only the next time you boot Windows. Each subsequent boot should proceed normally since the Prefetch data will already be present for the programs Windows loads when it boots.

If you want to disable Prefetch, open your Registry Editor, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Man ager\Memory Management\PrefetchParameters, and change the EnablePre fetcher value to 0. (Other supported values: 1 to Prefetch applications only, 2 to Prefetch boot processes, and 3 to Prefetch both.)

[Previous] [Contents] [Next]