The Prefetcher is a component of versions of Microsoft Windows starting with Windows XP. It is a component of the Memory Manager that speeds up the Windows boot process, and shortens the amount of time it takes to start up programs. In Windows Vista, SuperFetch and ReadyBoost  extend upon the prefetcher and attempt to accelerate application and boot launch times respectively by monitoring and adapting to usage patterns over periods of time and loading the majority of the files and data needed by them into memory so that they can be accessed very quickly when needed.
This feature is covered by US patent 6,633,968.
When a Windows system boots, a large number of files need to be read into memory and processed. Often, this includes loading different segments of the same file at different times. As a result, a significant amount of time is spent opening and accessing files multiple times, where a single access would be more efficient. The prefetcher works by watching what code and data is accessed during the boot process (including a reading of the NTFS Master File Table), and recording a trace file of this activity. Future boots can then use the information recorded in this trace file to load code and data in a better fashion. The boot prefetcher will continue to watch for such activity until 30 seconds after the user's shell has started, or until 60 seconds after all services have finished initializing, or until 120 seconds after the system has booted, whichever elapses first. Application prefetching works in a similar fashion, but is instead localized to a single application's startup. Only the first 10 seconds of activity are monitored.:458
The prefetcher stores its trace files in the "Prefetch" folder in the root Windows directory (typically
\Windows\Prefetch). The name of the boot trace file is always
NTOSBOOT-B00DFAAD.PF, and application trace files are a concatenation of the application's executable name, a hyphen, a hexadecimal representation of the hash of the path the file resides in, and a ".pf" extension. Applications that host other components (i.e. Microsoft Management Console or Dllhost) have the name of the loaded component included in the computed hash as well; this results in different trace files being created for each component.
Task Scheduler is the process responsible for parsing the trace data collected by the prefetcher and writing files to the prefetcher directory. As a result, the prefetcher will not operate correctly if the Task Scheduler service is not started.
An additional feature of Task Scheduler is its ability to interact with the Windows Disk Defragmenter. Every three days, when the machine is idle, a list of files and directories that are referenced during the boot process and application startups is created.:461-462 This list is stored in
Layout.ini in the Prefetch directory, and is subsequently passed to the Disk Defragmenter, instructing it to place all the files in sequential order on the physical hard drive, which will further improve startup performance, as Windows will spend less time waiting for the hard drive's heads to move to the relevant data. Alternatively, running "Defrag.exe %systemdrive% -b" from the command line forces a defragmentation of the prefetcher files without requiring a full defragmentation.
The Prefetcher's configuration is stored in the Windows Registry at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters. The EnablePrefetcher value can set to be one of the following:
- 0 = Disabled
- 1 = Application launch prefetching enabled
- 2 = Boot prefetching enabled
- 3 = Applaunch and Boot enabled (Optimal and Default).
The recommended value is 3.
Incorrect tweaking of the prefetcher 
The default prefetcher setting is to optimise the speed of boot time and application loading times. Values higher than 3 do not increase performance. (Note that 2 is the default value on Windows 2003). Changing the value to 2 will not make Windows boot faster.
Often found on the Internet is the "/prefetch:1" application tweak, which is a valid but nonetheless generally ineffective switch. A second myth is that the user should delete the prefetch folder contents to speed up the computer. If this is done, Windows will need to re-create all the prefetch files again, thereby slowing down Windows during boot and program starts until the prefetch files are created—unless the prefetcher is disabled.
Windows maintains entries(.pf files) in the Prefetch folder for the last 128 programs run.
See also 
- List of Microsoft Windows components
- Features new to Windows XP
- Windows Vista I/O technologies
- Windows ReadyBoost
- readahead - the equivalent Linux technology
- Russinovich, Mark; David Solomon (2005). "Memory Management". Microsoft Windows Internals (4th edition ed.). Microsoft Press. pp. 458–462. ISBN 0-7356-1917-4.
- Inside the Windows Vista kernel
- US patent 6,633,968
- "Misinformation and the The Prefetch Flag". Funny, It Worked Last Time. MSDN Blogs. 25 May 2005. Retrieved 2008-12-09. "[...] this has appeared on so many, many, many sites to be urban legend."
- "Misinformation and the The Prefetch Flag". Funny, It Worked Last Time. MSDN Blogs. 25 May 2005. Retrieved 2008-12-09. "Secondly, one can specify a /prefetch:#flag when launching an app. [...] Some sites have guessed that this switch turns on prefetching, and suggest that you add that to every executable you care about [...]"
- "Misinformation and the The Prefetch Flag". Funny, It Worked Last Time. MSDN Blogs. 25 May 2005. Retrieved 2008-12-09. "Both guesses are incorrect. The /prefetch:# flag is looked at by the OS when we create the process -- however, it has one (and only one) purpose. We add the passed number to the hash. Why? [~snip~]"
- "Beware of Bogus XP Advice".
- "Windows XP: Kernel Improvements Create a More Robust, Powerful, and Scalable OS".
- "Misinformation and the The Prefetch Flag". Funny, It Worked Last Time. MSDN Blogs. 25 May 2005. Retrieved 2008-12-09. "For one thing, XP will just re-create that data anyways; secondly, it trims the files anyways if there's ever more than 128 of them so that it doesn't needlessly consume space."