What is app launch prefetching and how does it help?
contributing writer: Rahul Nair
Applies To
Windows Server 2012, Windows 8
Explanation
Prefetching is the process of bringing data and code pages into memory from disk before it's demanded. Prefetching is a feature, introduced in Windows XP that monitors the data and code accessed during application startups and uses that information at the beginning of subsequent startups to read the code and data proactively in an efficient manner to improve performance.
Prefetch data per application is stored as .pf files under the \Windows\Prefetch directory. For the cases where the file access pattern for the same application startup (i.e. process or executable) is consistently different, prefetching can be not as efficient because it cannot build up a consistent history. In Windows Server 2012 and Windows 8, prefetch will have a new feature that allows applications to specify a parameter to distinguish specific application startup “modes” versus regular application startups. The system would maintain separate .pf files for each parameter (1-8, 0 being the default pf file) specified.
Format/Intended Usage and Definition
A process can be configured with the prefetch parameter with the following format: (Note: The prefetch parameter is case-sensititve.)
process.exe /prefetch:Num
where Num is the .pf file number
The prefetch parameter helps when starting an application where significantly different file access patterns are expected, For example:
- Media center application starts can specify the data source of TV, music library, or DVD playback. In this case, the executable is the same, but accesses different data files when starting. In this case, the prefetch parameter can be used to distinguish between data sources to make starting the application faster.
- For browsers, the frame process and tab process could use separate code paths. Specifying a different prefetch parameter for the frame process and the tab process allows Windows to distinguish these process startups, where Windows previously considered the frame process and tab process to be the same, as both processes were from the same executable. Browser developers need only specify the parameter corresponding to frame process startup or tab process startup.
Related Information
- Windows XP: Kernel Improvements Create a More Robust, Powerful, and Scalable OS, http://msdn.microsoft.com/en-us/magazine/cc302206.aspx
- The Windows 7 Boot Process (sbsl), http://social.technet.microsoft.com/wiki/contents/articles/11341.the-windows-7-boot-process-sbsl.aspx
- Event ID 106 - Microsoft-Windows-Diagnostics-Performance, http://social.technet.microsoft.com/wiki/contents/articles/3566.event-id-106-microsoft-windows-diagnostics-performance.aspx
- What is the prefetch folder? http://windows.microsoft.com/en-US/windows7/What-is-the-prefetch-folder