Prefetcher is a component of the Microsoft Windows operating system that accelerates the process of its initial loading , as well as shortens the time to launch programs. Prefetcher first appeared in the Windows XP operating system. Starting with Windows Vista , it has been enhanced with SuperFetch and ReadyBoost technologies.
Content
Description
Running Windows and applications is accompanied by reading into memory and processing a huge number of files. Often, the same file is opened several times to read different segments. Such irrational access to files takes a lot of time. It is much more efficient to access each file only once, loading information into RAM even before programs need it. Prefetcher monitors which code and data (including the NTFS Master File Table ) are loaded during the launch of the operating system and applications. It accumulates this information in trace files to optimize the loading of code and data during the following launches.
Prefetcher monitors the launch of each application for the first 10 seconds. Monitoring of the system boot process is time limited and stops in the following cases [1] :
- 30 seconds after the launch of the user shell
- 60 seconds after the completion of the initialization of all services
- after 120 seconds from the start of the system boot
Trace files are saved in the Prefetch folder of the Windows root directory [2] (usually C:\WINDOWS\Prefetch
). The loading of the operating system is traced to the NTOSBOOT-B00DFAAD.pf
file. The launch of programs is traced into separate files whose names consist of the name of the executable file of the program being launched, the hyphen, the hexadecimal hash of the path to the executable file and the extension “.pf” (for example: EXPLORER.EXE-082F38A9.pf
). When launching applications that are a working environment for other components (for example: DLLHOST.EXE
, MMC.EXE
, RUNDLL32.EXE
), the name of the loadable module is also added to the hash, as a result, different trace files are created for different components (for example: MMC.EXE-0B0171A2.pf
, MMC.EXE-393F4B82.pf
).
An important role in the work of the Prefetcher component is the Task Scheduler service . The Task Scheduler analyzes the data from the Prefetcher and writes the trace files to the %SystemRoot%\Prefetch
folder. If the service is not running, Prefetcher will not work correctly. Task Scheduler also interacts with the Windows Disk Defragmenter . Every three days, when the computer is idle, a file called Layout.ini
is created in the %SystemRoot%\Prefetch
folder, which stores the list of files and folders used when the operating system was loaded and programs started. The disk defragmenter uses the information from the Layout.ini
file for the optimal physical placement of these files on the disk.
Setup
Prefetcher parameters are stored in the system registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters
[3] . The EnablePrefetcher
(DWORD) parameter can be one of the following values:
- 0x00000000 - the component is disabled
- 0x00000001 - application launch acceleration
- 0x00000002 - system loading acceleration
- 0x00000003 - accelerating the launch of applications and system boot
Changing the EnablePrefetcher
parameter takes effect immediately.
RootDirPath
The system prefetch file, the initial load is located in the% SystemRoot% \ Prefetch directory and the path to it is specified by this parameter.
Default = Prefetch
Myths
There are several common myths about the Prefetcher:
- Adding the “/ prefetch: 1” key to the application launch line speeds up its loading.
- This myth is based on the fact that after installing the operating system, the / prefetch: 1 key is initially specified in the Windows Media Player launch line. In reality, the addition of this key does not in itself have any effect, and in some cases the application may refuse to run at all [4] .
- Deleting files from the
%SystemRoot%\Prefetch
speeds up your computer.- This myth is based on the assumption that there
%SystemRoot%\Prefetch
too many files in the%SystemRoot%\Prefetch
folder, so Prefetcher starts to slow down the system. In reality, clearing the above folder slows down the computer until trace data has been accumulated again [4] .
- This myth is based on the assumption that there
- Over time, the
%SystemRoot%\Prefetch
folder begins to take up a lot of disk space.- In order to save disk space, the maximum number of trace files is limited to 128 [4] . Cleaning the
%SystemRoot%\Prefetch
not required, since the Prefetcher services itself automatically without user input [2] .
- In order to save disk space, the maximum number of trace files is limited to 128 [4] . Cleaning the
Notes
- ↑ Windows XP: Create a More Robust, Powerful, and Scalable OS - From the December 2001 issue of MSDN Magazine.
- ↑ 1 2 What is the prefetch folder? - Windows Vista Help.
- ↑ Kernel Enhancements for Windows XP - Windows Hardware Developer Central. January 13, 2003.
- 2 1 2 3 The Prefetch Flag - Funny, It Worked Last Time. MSDN Blogs. May 25, 2005.
See also
- Windows ReadyBoost