Configure the logical prefetcher for faster application start

29 December 2001 by Snakefoot | Comment » | Trackback Off
Windows XP includes a new enhancement to the memory management. It is called the Logical Prefetcher and it can make boot time and application start time faster. The Logical Prefetcher records disk usage in certain scenarios (Bootup and Application start), and when the same scenario reappear, it loads all the data needed for that scenario from disk to memory, before the data is requested.

The behavior of the Prefetcher is controlled with this DWORD registry key:

[HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Control \Session Manager\ Memory Management \PrefetchParameters]
EnablePrefetcher = 3 (Disabled = 0, Application = 1, BootUp = 2, Application AND BootUp = 3)

Note Windows Home and Professional edition will by default enable the prefetcher for both Application and BootUp. Windows Server edition will by default only enable the prefetcher to optimize bootup.

Note if using other values like 5 or 6 then it will either disable the prefetcher or only activate one of the prefetching types.

Note the Prefetcher is a service that runs in background and monitors disc and memory usage, and this monitoring requires CPU and RAM. If having less than 800 Mhz CPU and 512 MByte RAM, then one should consider only to enable the BootUp prefetcher.

More Info MS KB Q307498

The Task Scheduler notifies when a process has started, causing the prefectcher to start monitoring the first 10 secs of the process start, and then saves the recorded disk activity caused by the process in a *.pf file in the Prefetch-directory:

C:\WinNT\Prefetch or C:\Windows\Prefetch

Note if deleting the contents of the prefetch directory, then it will loose all history of how to optimize the launch of application and will ruin the concept the prefetcher.

Note it can be a good idea to clear the prefetch directory when having applied a service pack for Windows or other applications, so the optimizer will quickly adapt to the updated files. Also if using AntiVira software, then this directory should be excluded to lower disc activity.

The Prefetch-directory also contains a file Layout.ini, which is generated from the saved scenarios. The Layout.ini is used when doing a full defragmentation where frequently used files are aligned for faster loading. The Layout.ini is by default generated automatically, but one can also force the generation with command (Will run for 1-10 min):

rundll32.exe advapi32.dll,ProcessIdleTasks

Note one can do a quick/partial defrag according to the Layout.ini, and only optimize the boot- and application- files for faster startup using Defrag.exe:

defrag c: -b

Note the generation of the Layout.ini and the partial defragmentation (dfrgntfs.exe) is automatically started when the computer is idle (or within every 3rd day). One can configure this automatic defragmentation of the computer with these registry keys:

[HKEY_LOCAL_MACHINE \SOFTWARE \Microsoft \Windows \CurrentVersion \OptimalLayout]
EnableAutoLayout = 0 (Optimize Programs=1, Disabled = 0, Default = 1)

[HKEY_LOCAL_MACHINE \SOFTWARE \Microsoft \Dfrg \BootOptimizeFunction]
Enable = "Y" (Optimize Booting="Y", Disabled = "N", Default = "Y")

Note other processes also starts when the computer is registered as idle, so if having problems using the computer after it has been idle, then it is most likely caused by the Indexing Service.

More Info MS KB Q313300

More Info MS WHDC - Benchmarking on Windows XP
More Info MS WHDC - Kernel Enhancements for Windows XP
More Info MS MSDN - Windows XP Kernel Improvements

Credits TweakXP.com

Updated: 31 July 2010

Comments:

Comment by Larry Miller - 17 March 2009 @ 16:41 Reply

The description of prefetch above is largely correct but easily misunderstood. Application prefetching does NOT occur at boot time. Application prefetch files are referenced only after application launch has been initiated and are used to optimize the process. This cannot really be understood without a solid understanding of how virtual memory works.

Application prefetch will be beneficial with as little as 64MB of RAM but full benefits require 128MB. In some cases prefetch will not benefit an application. If Windows determines that this is the case the specific prefetch entry will not be used. It will not be deleted as this would simply force it’s recreation on the next application launch.

Note that the Microsoft article mentioned above only refers to disabling prefetch for testing purposes, not as a means of improving performance.

Larry Miller
Microsoft MCSA

Comment by Roberto - 18 June 2011 @ 11:28 Reply

I would like to give a big compliment to those who have built this web site. It is the only one so far that I can find that has professional descriptions of processes and services with the advice for the default settings. Things you don’t find anywhere else. A few items I was looking for are missing, but…nobody is perfect. I suggest including the search for the name of the file of the service in the search box usage as it works only in some filenames and in others don’t and you have to search for the service name. Great work anyway. Keep it up!

Comment by Roberto - 18 June 2011 @ 11:47 Reply

My suggestion here is to include the suggested settings for this service: diabled, manual or automatic.

Leave a comment


NB! Use the Forum for computer help and off-topic questions.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>