Yet another Web site posted yet another “tip” today recommending that you clean out your Prefetch folder to improve performance of Windows. Arrrggghhh! I’ve written about this repeatedly (here and here and here, for instance), but the message doesn’t seem to be spreading very fast. Maybe this quote from “Misinformation and the Prefetch Flag” by Ryan Myers, a developer on Microsoft’s Windows Client Performance Team, will help:
XP systems have a Prefetch directory underneath the windows root directory, full of .pf files — these are lists of pages to load. The file names are generated from hashing the EXE to load — whenever you load the EXE, we hash, see if there’s a matching (exename)-(hash).pf file in the prefetch directory, and if so we load those pages. (If it doesn’t exist, we track what pages it loads, create that file, and pick a handful of them to save to it.) So, first off, it is a bad idea to periodically clean out that folder as some tech sites suggest. 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. So not only is deleting the directory totally unnecessary, but you’re also putting a temporary dent in your PC’s performance. [emphasis in original]
Bottom line: You will not improve Windows performance by cleaning out the Prefetch folder. You will, in fact, degrade Windows performance by cleaning out the Prefetch folder. I’ve done performance testing that establishes this definitively. In all the many sites that offer this bogus tip, I have yet to see a single piece of actual performance testing.
Oh, and for anyone who cites this TechRepublic article as a source, let me just say that it contains more serious factual errors than I can count. For instance:
As you boot your workstation or access programs on your workstation, XP’s prefetcher copies portions of those files to the Prefetch area of your hard drive.
That’s completely wrong. The files in the Prefetch folder contain lists of pages that that should be loaded when a program starts. Each file is essentially an index. Windows XP doesn’t copy portions of any files to the Prefetch folder.
When your workstation boots, XP prefetches portions of the files you use most frequently and has any application you’ve recently run waiting and ready to go.
This is equally absurd. If this were true, it would mean that Windows was actually loading into memory every program you’ve ever used, every time you start Windows. That’s not the way it works at all. When your PC starts up, Windows looks in the Prefetch folder to determine how best to load Windows. It doesn’t do a thing with the .pf files for applications (unless, of course, you’ve configured one of those apps to start up with Windows).
If you’re frequently using the same few applications over and over again, prefetching can greatly increase the apparent speed of a system. Rather than waiting for you to click an icon to start a program, and then loading all of the associated files, libraries, and pointers necessary to run the program, XP has all the components of your programs preloaded. When you click an icon to start the program, most of the hard work is already done.
The author just made this up. The .pf files don’t get used at all until you run a program. What actually happens when you click an icon is that Windows uses the information in the Prefetch folder to decide which program segments to load and in what order to load those pages. There’s plenty of documentation for this, including Ryan Myers’ article and this definitive article by Mark Russinovitch and David Solomon, Windows XP Kernel Improvements Create a More Robust, Powerful, and Scalable OS.
The drawback to prefetching is that XP will prefetch a program even if you use it only once or twice. XP will retain a copy of a portion of it in the Prefetch folder. From there, it will prefetch the program, taking resources from your workstation even though you may have no intention of ever using the program again.
Again, the author just pulled this out of who-knows-where. When you run a program, Windows creates a .pf file for it in the Prefetch folder. When you run the program again, Windows looks for this .pf file and uses it to determine how to load the program. The hash doesn’t contain any portion of the original program code. If you never run the program again, that .pf file never gets used, and in fact it gets deleted eventually.
I used to write for TechRepublic. I’ve tried to contact someone there to get them to correct this silly article but have yet to receive a response. It would be really, really great if some of the other sites that have propagated this urban legend would also correct it.

To anyone begging for help fixing their virus: Use a virus scanner, and update it! That’s what they’re for! Preferably something like Avast or Antivir that can be run boot-time or offline from a CD.
I suspect most of the “speedup” people claim to get from disabling prefetch is related to doing a whole laundry list of cleaning and tweaking at once, and picking one thing to blame it all on, then never successively timing it on/off to be sure. Notice how no one in this thread who’s defended the matter has come back with hard numbers.
However: If you ever see a file in there that doesn’t follow the convention, like a dash instead of a dot or vice versa – it is a virus. If you ever can’t delete a file (as admin) in that folder – it is a virus. If it’s in task manager, then of course it’s a freaking virus. Don’t screw around, get a boottime antivirus on it immediately! Or pull the drive out and take it to a friend’s, scan it on their system. And be more careful next time.
Well there is no “tweaking” that will improve Windows boot times outside of disabling unnecessary services (be careful since the Task Scheduler service is necessary for prefetching and disabling certain services can break things in Windows). Cleaning can help, such as removing malware and disabling or uninstalling unnecessary applications that load at Windows Startup.
Anyone claiming ANY performance from so called Prefetch cleaning or “tweaking” away from the defaults is either showing placebo results or for “cleaning” had a corrupt prefetch file which indicated a problem with your system and on a properly working system would never happen.
I challenge anyone to prodiuce documented reproduceable results on a clean install of XP with absolutely nothing done to it outside of the one alleged “tweak” or prefetch folder cleaning to show a performance improvement. Quite the contrary you will find a NEGATIVE performance hit.
The greatest offense of accumulated files in the Windows\Prefetch folder for me is that they result in significant fragmentation of the OS partition. If I don’t empty the Prefetch folder first, I cannot achieve a good defragmentation. I DID have an incident in the past in which a virus EXECUTABKE file installed itself in the Prefetch folder, but of course, I only deleted that one file in that case.
Louise,
That is total nonsense. The prefetch trace files (.pf) are like any other file on your HD and can be defragmented normally either by the built-in disk defragmenter or a superior third party utility like Diskeeper. They in no way cause OS fragmentation any more than any other file. It is like there are people out there obsessed with finding any ridiculous reason to delete the contents of the folder. Some people cannot stand to just leave it alone.
Sorry, but you’re wrong, wrong, wrong.
Clearing out prefetch periodically DOES speed up the computer. FACT!
Windows XP pre-loads files it thinks are might need in prefetch, but actually you may not want any of them so they’re just using up resources, a bit like carrying a couple of bags of cement in the back of your car all the time, you use more fuel carrying the extra weight.
Peter,
Did you read Ed’s post or the replies in this thread before you posted that misinformed statement? That is not what prefetch does. Windows XP does not load ANY files that Windows XP or an application would not already load. It simply optimizes how they are loaded. No additional files are “pre-loaded” to take up “resources”. That is NOT how it works. Please READ and understand how something works before you post a comment incorrectly assuming.
“Did you read Ed’s post or the replies in this thread before you posted that misinformed statement? That is not what prefetch does. Windows XP does not load ANY files that Windows XP or an application would not already load. It simply optimizes how they are loaded. No additional files are “pre-loaded” to take up “resources”. That is NOT how it works. Please READ and understand how something works before you post a comment incorrectly assuming. ”
But that is why *sometimes* cleaning out the Prefetch DOES improve performance. The prefetches are NOT parts of an EXE – they are hash tables to tell the OS the best load pattern for the program.
But during startup the Prefetch folder’s FAT entries must still be parsed to find the correct hash, that hash loaded then executed upon. The larger the folder the longer the IFS takes to parse a directory. Known fact.
Don’t get agressive in emptying that Prefetch – but once in a Blue Moon clean it and restart the machine at least 5 times (for the OS to rebuild the prefetches necessary, but only the required ones necessary). You’ll find that your OS initial load time drops by about 15%.
I suggest you try it – theory and reality sometimes do not coincide. Theory says “no”, reality says “yes”. But do not do it often!!! Once every 3 to 6 months – to force a rebuild of the hashes to your current mode of OS use – is more than adequate. Any more and yep, you’re probably doing more harm than good.
Sorry, Snake, you’re wrong.
Restarting your computer 5 times won’t do jack to rebuild prefetch hash files. You need to actually run the programs to build those .pf files.
And if the program itself changes, it gets a new hash file. You don’t need to delete the old one. I have a Media Center machine here that has been running continuously since November. I have never manually done anything with the Prefetch folder. Yet the oldest prefetch hash file in that folder is dated only two days ago. Layout.ini is dated yesterday, and the NTOSBoot file is dated one week ago.
You don’t need to mess with the Prefetch folder. It can take care of itself.
Like Ed said Snake you are wrong.
Snake that is total nonsense if the size of the folder’s contents effected a program’s load time then this could easily be timed. The folder’s file limit is 128 entries before Windows XP auto cleans it. I’ve timed systems boot and applications loads with a handful of files in the folder and the folder maxed out at 128 entries and the load times DO NOT CHANGE.
“But during startup the Prefetch folder’s FAT entries must still be parsed to find the correct hash, that hash loaded then executed upon. The larger the folder the longer the IFS takes to parse a directory. Known fact.”
NTFS doesn’t use FAT! Regardless like I said this could easily be timed and I have and the size of the folder’s contents in no way negatively effected the load times of Windows or the applications. Your the one making assumptions and creating incorrect “theories”. How Windows XP Prefetching works is fully documented.
“Don’t get agressive in emptying that Prefetch – but once in a Blue Moon clean it and restart the machine at least 5 times (for the OS to rebuild the prefetches necessary, but only the required ones necessary). You’ll find that your OS initial load time drops by about 15%.”
Wrong it only takes Windows 1 reboot to rebuild the NTOSBoot file and a second to fully optimize it. This is the same with launching ANY application, it is fully optimized after the second load but 90% of the optimization was already done the first time. Windows only builds one Prefetch file during boot and that is the NTOSBoot file. Like Ed said you have to launch applications to build the rest, rebooting Windows does nothing for them.
Snake I suggest you learn how Windows prefetching works and stop spreading complete misinformation and nonsense. People who are seeing performance loss at boot or applicatoin loads either have prefetching broken or disabled in some way or are not letting their systems go idle (ten minutes) which is when the Prefetch files are further optimized. I suggest these people force the idle tasks to run instead of listening to this nonsense.
That can be done by going to Start, Run and Typing:
Rundll32.exe advapi32.dll,ProcessIdleTasks
and you can then further optimize this by typing:
defrag c: -b
Again Windows does this all automatically and you don’t have to do anything but for whatever reason people manage to create new and interesting ways to deoptimize their systems daily.
thanks for this posting
regards
I’m one of those people who has written guides that recommend disabling prefetcing. I do it on my own rigs after I noticed an improved boot time some time ago. After seeing this article I decided to do some testing.
With prefetching off, my boot from power on to the dissappearance of userinit.exe in Task Manager was 79secs. I tested 7 apps I commonly use. Their respective load times (in seconds) were 33, 17, 12, 4, 4, 4, 4.
I re-enabled prefetching (Task Scheduler Service), rebooted three times, ran those apps to generate the prefetch hashes, verified the hashes for those programs were there and shut down the PC. Left the PC for about 30secs then powered on. Boot time from power on to the dissappearance of userinit.exe in Task Manager was 81secs. The load times were 33, 17, 12, 4, 4, 4, 4. No change except for two seconds extended Windows boot time.
Although my testing wasn’t extensive, I’ve learnt a few things from this article.
- Disabling prefetching is over-rated.
- Enabling prefetching is over-rated.
- Boot time variations from leaving prefetching enabled are likely to be negligible.
- Performance differences come down to the individual’s PC’s and how they use it. On my PC and for my use, it’s a moot topic.
If you really want to improve boot times and load times, get a fast hard drive and make sure you have ample RAM. You can’t substitute pure grunt with a myriad of tweaks.
If you are fussed about tweaking prefetching, try it on and off and time your own PC with the apps you use. make up your own mind.
I’ll keep prefetching on for a month or so and will report back if my observations change.
For reference, I wholeheartedly agree that many tweaks can degrade performance and I applaud you guys for taking the time to debunk them.
The Point of clearing the predfetch folder is, that if you install new software and afterwards deinstall it, windows will still try to optimize the disk for the non-existing software. Of course, there is no point in flushing this folder daily, but after a month or two it IS quite useful and speeding up the system. On my test-system where I have to install many different software-packages, the boottime decreased from 20secs to only 7!
I have a problem with long load times for some processes, up to 8 minutes.
Having read this page I disabled prefetch and the load time reduced to 2 minutes. Still something is wrong but I also ran my antivirus scan and was surpried to find the normal 18 to 20 minutes for a scan before disabling prefetch the scan only took 8 minutes.
The problem with using a stop watch is that so many processes are running in the backround timing two runs with only the presence of prefetch different is not posibble.
How does prefetch get affected by smartdrv or has this been removed in windows.
At least smartdrv had a monitor in it so you could see the effect. Does prefetch have similar monitor.
It seems timing the boot up process is not a good test of prefetch. The point of prefetch like smartdrv is to pay a small penalty the first time a block of code is used to save time later in the session when the same block of code is needed again. In the case of smartdrv the session was as long as the machine was switched on but with prefetch holding data on disk the “sesion” is much longer.
I had a problem with defraging om my hard drive and it was saying that it was in the prefetch folder. deleted it and it has worked ok.
50, first of all the Task Scheduler Service is merely one thing that must be set to automatic.
1. You cannot use an nLite install of XP for testing since parts of XP may have been ripped out.
2. The EnablePrefetcher Registry Value must be set to 3.
3. You must do the following procedure after rebooting 3 times. Go to “Start”, “Run”, Type Rundll32.exe advapi32.dll,ProcessIdleTasks. This can take 10-15 minutes to run but no notification will be given when it is finished. You will notice increased Harddrive activity while it is running wait until this stops. When this is finished in the “Run” box Type defrag c: -b. This is necessary to confirm the idle tasks were run.
When timing with a stopwatch you must time from pressing the power button until startup.
All you have proved is that Prefetching is broken on your system in some way or your testing is flawed. Perform a clean non nlite install and test again. When you say Prefetching is “off” you need to make sure the Task Scheduler is disabled, the EnablePrefetcher value is set to 0 and the Prefetch folder is empty.
Christina,
That is impossible if you uninstalled the software then there are no files for the defrag prefetch optimization to move when the system is idle in relation to those programs. Your boot times decreasing had absolutely nothing to do with cleaning the Prefetch folder. I suggest you provide documented reproduceable tests on a clean non-nlite install of Windows XP. Of which no one will be able to reproduce your results because it simple does not work that way.
Mick,
Why in God’s name would you read this page and disable prefetching? That is not your problem! If you think it is you obviously did NOT read this page!
AntiVirus scan times are irrelevant to prefetching. Prefetching only accelerates application and windows load times.
Smartdrv? Are you kidding me! That is a DOS program. Prefetching is only found in Windows XP and Vista.
PREFETCHING HAS NOTHING TO DO AND IS IN NO RELATION TO SMARTDRV!!! There is NO PENALTY, NONE, ZIP, NADDA. STOP MAKING STUFF UP!!!!
Testing boot time is an EXCELLENT way to test boot prefetching. Since this is one of the things prefetching accelerates.
Please do not comment here if you are not going to at least take the time to read the whole thread and all the explanations. Don’t guess and assume because you will be wrong.
David,
If you had a problem with the prefetch folder that was likely due to a disk related problem or a file system related problem. Neither of which has anything to do with prefetching. There are many reasons the prefetch folder can get corrupted. You need to fix the source of the fiile corruption not delete the prefetch folder.
Causes of file corruption in XP:
1. Overclocking
2. Defective Harddisk
3. Using Fat32 instead of NTFS as the file system
4. Defective RAM
5. Defective Mainboard
6. Defective Power Supply
The files in my prefetch folder are compressed. Is that the way they should be? If not, what happened there? Should I do anything about it?
Hi
just to let you know that I had found Ad-Aware in my
C\WINDOWS\prefetch under FIREFOX.EXE.————–pf and IEXPLORE.EXE———–pr
This Virus will launch and open your browser with a new page