Prefetcher
From Wikipedia, the free encyclopedia
This article or section is in need of attention from an expert on the subject. Please help recruit one or improve this article yourself. See the talk page for details. Please consider using {{Expert-subject}} to associate this request with a WikiProject |
The Prefetcher is a component of versions of Microsoft Windows starting with Windows XP.[citation needed] 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 [1] 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.
Contents |
[edit] Overview
When a Windows[clarify] 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 reads 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 more optimal 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 is monitored.[citation needed]
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.
It is important to note that the 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 the 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. 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 defrag.[citation needed]
[edit] Configuration
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.
[edit] Incorrect tweaking of the prefetcher
The default prefetcher setting is to optimise the speed of boot time and application loading times; there is no need to alter this setting.[clarify] There are myths on the internet that values other than 3 (see above) are somehow faster. Values higher than 3 DO NOT increase performance - it's a fallacy that's been circulating the internet. Many all-in-one tweaking and other windows tweaking applications may incorrectly set the prefetcher value, often setting it to 2 instead of the recommended value of 3. By doing so, boot times are not reduced and applications will load more slowly. Users are advised to check this value is still set to 3 after using any windows tweaking software. [2]
Often found on the Internet is also the "/prefetch:1" application tweak, which is proven to be a myth and completely useless.[3] 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.[4] [5]
Windows also maintains the Prefetch folder at 128 entries.[6] In most cases, its size never reaches or exceeds 10 megabytes.[citation needed]
[edit] See also
- List of Microsoft Windows components
- Features new to Windows XP
- Windows Vista I/O technologies
- Windows ReadyBoost
[edit] References
- Russinovich, Mark; David Solomon (2005). "Memory Management", Microsoft Windows Internals, 4th edition, Microsoft Press, pp. 458-462. ISBN 0-7356-1917-4.