This question appeared on a bulletin board recently:
Someone suggested deleting the contents of the Prefetch directory in Windows XP on a weekly basis, to speed up the boot process. Is that good advice?
The Internet has a way of taking questionable facts and giving them a life of their own. Even bad advice about Windows has a way of spreading, just like urban legends. This is one of those “tips” that doesn’t survive even a cursory analysis.
The Prefetch directory serves a valuable purpose by analyzing files that you use at startup and when you run programs. Contrary to what some well-meaning but technically inaccurate articles suggest, this does not copy the files themselves. It creates an index to the location of those files on the hard disk, including the order in which they’re loaded. This allows Windows and Windows programs to start very quickly after the first time you use them.
The Prefetch directory has one additional salutary function when used in conjunction with the built-in defragmenting tool. Every three days, during idle times, this utility rearranges program code, moving it to the outside of the disk to make it more efficient when loading (to force Windows to perform this optimization without having to do a full defragmentation, use the Defrag.exe command with the -b switch. For instance: defrag c: -b).
Carl Siechert, Craig Stinson, and I actually devoted several pages of Windows XP Inside Out to this topic. That was almost two years ago, though, and I’m willing to keep an open mind that we might have missed a great tip. So, just for grins, I got out my stopwatch and clocked my system boot time. Then I cleared out the Prefetch directory and did it again. My system has been running nonstop for 7 months and I have never touched the Prefetch directory. If this “tweak” were going to do any good, surely it would have maximum effect on my computer, right? The results were illuminating.
I timed from power up, starting with the first beep (POST code) to the point where the hourglass cursor disappeared.
With a full Prefetch directory:
… 0:50 to login screen
… 1:08 to desktop
After emptying Prefetch directory:
… 0:58 to login screen
… 1:57 to desktop
In other words, it took me nearly a minute longer to boot after using this “speedup” tip!
When I Googled for this topic, I found tons of examples of people who had simply copied this advice to their list of “tips” without any explanation of why it would be valuable or whether it actually affects performance. Mark Russinovitch and David Solomon, for instance, wrote an excellent article called Windows XP Kernel Improvements Create a More Robust, Powerful, and Scalable OS in the December 2001 issue of MSDN Magazine. Their technical credentials are impeccable, and they speak very highly of this feature.
The few people who did discuss it in those terms were unanimous in recommending that you leave Prefetching on.
Furthermore, why worry about boot times anyway? I recommend that most people avoid restarting their computer except when it’s absolutely required. Windows XP is so stable you can leave it running for weeks at a time and only restart on those rare occasions when you have to do so. If you need to shut down the computer, use the Hibernate option instead, which allows you to resume in seconds, with all your programs loaded just the way they were when you shut down.
If you really want to improve performance, forget bogus tweaks like this one and do the following: increase the amount of RAM in your computer (at least 256MB), get a good defragmenter (Diskeeper is the best), and remove programs you don’t use (or at least configure them so they don’t start automatically).
Update, March 2005: This “tip” just won’t die. It still appears all over the Internet, including at some places that should know better. We revisited the topic for the second edition of Windows XP Inside Out and found that cleaning out the Prefetch folder still does nothing positive for performance. If you think otherwise, get a stopwatch and run your own tests.
Update, May 2005: Microsoft’s Ryan Myers has an excellent blog post on the subject, entitled “Misinformation and the Prefetch Flag.” Here’s the money quote: “[I]t 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.”
Be sure to read these follow-up articles as well: Don’t clean out the Prefetch folder, Debunking yet another bogus Windows tip, and One more time: do not clean out your Prefetch folder!
I agree 100% about NOT deleting the prefetch stuff…
But..now you know there would be a but… I do NOT agree with leaving your PC on all the time unless there is a reason to do so.
I live in Las Vegas. It is hot enough without having a pc on 24/7. We even purchased a window air-conditioner for our computer room. The only other way we could try to cool off this room was to freeze out the rest of the house!
Besides the electric bill, I am not in favor of wasting energy for no reason. Or at least..I want to conserve what I can. They are talking about having different rates for different times of the day..to give folks an incentive to reduce their electrical costs. Since we do not work (retired) I have no problem keeping a schedule which goes with my body’s natual rythms..and stay up late and sleep in late in the morning. This will allow me to keep my pc off during the hottest part of the day.
Thanks for you good advice.
Rose
I would actually have do disagree. The purpose of clearing the prefetch cache is to clear out old junk that isn’t being used, yet the computer tries to fetch. Obviously, biweekly is too short a time, but every 3 months would do the trick.
I would like to see what your boot times would be like, after using the computer for a week after clearing the prefetch. If you had obsolete information, I bet the time is slightly improved. It would depend on the user though, and how often they change the programs they use, etc.
I think you’re still missing the point. Windows doesn’t actually load anything from the Prefetch directory. It simply lists locations where it should load stuff if you run a program. When you run the program, Windows checks to see if there’s an entry in the Prefetch directory; if so, it uses that index to efficiently load the program and its associated resources. If it doesn’t find an index entry, it creates a new one.
You don’t need to manually clean it out. On my system, which has not had the Prefetch directory cleaned out since I posted this original note on April 18, the oldest entry in the Prefetch cache is only 10 days old.
The other pages I’ve seen discussing prefetching do not agree with you that “Windows doesn’t actually load anything… [] It simply lists locatins where it should load stuff if you run a program”.
They say that Windows *does* load stuff *before you use it*. For example, techrepublic says “Using its prefetch capabilities, Windows XP tries to load the programs you need before you need them. ” jsifaq.com says “Prefetching is the process of bringing data and code pages into memory from disk before it’s demanded. ”
I’m pretty sure from personal experience that these sites are right. Executables pointed to in the prefetch directory are run.
-Dan D
Sorry, Dan, that’s not correct. Go read the technical articles I referenced to learn what Prefetch really does. For that matter, go look at the files in your Prefetch folder. They are simply layout files, which show where the segments of a particular executable and associated DLLs are located.
The Prefetch layout for a program tells Windows, “Based on previous experience, when the user runs this program, you will need to load the following files in the following order.” In many cases, the exact order in which segments of a program are loaded is different from the way they are arranged on the disk, so Prefetch in combination with the Defrag tool rearranges data on the disk to make it load more efficiently.
I presume you are referring to this TechRepublic article. I found at least three gross technical errors just in skimming it over. It is clear the author simply doesn’t understand how Prefetch works.
You could of course prove all this for yourself by using a process monitor and a stopwatch. Notice that the author of this article didn’t document any performance testing to prove that his “tip” (which includes the same incorrect advice published elsewhere on the Internet) actually does anything.
Sorry to disagree with you regarding prefetch folder, to deleate contents or not ?
certainly not every week,but from time to time, is in my veiw a good way to increase boot time,
Why, just take a look at the prefetch contents, short cuts to progs. and other bits long deleated from the hard drive,
If you clear prefetch contents it will take about 5 start up’s to re-enter the programs that you use day to day,then get out the stop watch, it will be quicker, me, I boot and time the same way as you, in 35 sec.xp prof. 2.7 ghz 1 gig ram sp1a installed
As a new user to XP, I have been researching the prefetch file and have found conflicting information. I have noticed if I delete an item from the prefetch folder but do not take it out of the layout.ini file, it takes longer to boot. (For example, changing a service to manual and then removing it from the prefetch file. If I do not take it out of the layout.ini file, it puts it back in the prefetch folder. Does the layout.ini file get updated as prefetch files are no longer needed?) Does Diskeeper 9 move the prefetch files to the outer segment of the disk when you do a boot defragmentation?
Interesting question! I don’t think there should be much relation between the individual prefetch files and Layout.ini and boot performance. They serve separate functions. I’ve never tested that specific scenario, though, and won’t have a chance to do so for another couple weeks. I’ll give it a try later.
I would certainly think that Diskeeper uses Layout.ini but can’t say for sure.
I have a question that might pertain to this or may not…i’m not sure if you can even answer it heh. I have something like an error message that pops up on my desktop before Windows shuts down; AFprk.exe-DLL. I found it in my Prefetch file. If i’m reading correctly on what you’ve all said then I should keep them all intact and not get rid of them? Any information would be highly appreciated since Microsoft.Com told me absolutely nothing.
Thanks. ^.^
Lisa, that file in the Prefetch folder is completely unrelated to your problem. Without a lot more information, it’s difficult to say what’s going on.
Look up Hare 1.5.1 from http://www.dachshundsoftware.com it eliminates prefetch folder
Why on earth would I want to eliminate the Prefetch folder?
Just ran across this page randomly, but had to laugh pretty heartily at the whole situation. Keep fighting the good fight, Ed. I totally agree, there is not one piece of hard evidence to indicate that deleting/clearing/moving/whatevering the prefetch folder makes any difference.
I believe people see old file/program name references in that folder and just overreact thinking it must be old cached data that is slowing things down.
If only people would spend as much time worrying about what new crappy shareware they are randomly installing as they do about this mysterious prefetch folder or other similar “performance tweaks” I firmly believe people would see general and noteable performance “gains” (they aren’t really a gain if it’s just avoiding a “reduction”…)
I also agree with you about the RAM. Short of a complete system overhaul, I’ve rarely seen anything come as close to a good ol’ kick in the butt for increased performance as adding more RAM does. And with 512MB sticks going for ~$50 or less, I can’t see anyone’s reasoning for not just adding a bit more.
Seems to be some misconceptions about how the prefetch works.
The first thing to consider when deleting from the prefetch folder is that your next restart is going to take longer than normal. That could theoretically be true for your next couple of restarts, but is certainly true for your next one.
Next is why would you want to empty the folder. I would argue that you should, only under certain conditions. Those conditions are:
1. You are constantly installing–trying out–then uninstalling allot (a whole lot) of software.
2. Your system is sluggish and you’ve tried the most common tips to make it lively again.
IMHO it would take tons of bogus entries to slow the system down noticably, but there is a chance so don’t count the prefetch off limits. Just don’t be too quick to dump it. You will almost certainly defeat its attempt to make your system run better if you do it too often.
Well, Fr33d0m, your argument would be a lot stronger if you supported it with some real-world testing and shared the data. I’ve tested with a stopwatch. There is essentially zero impact on startup time after emptying the Prefetch folder. And since the total amount of data in the Prefetch folder typically adds up to a few megabytes (megabytes), and it is automatically purged on a regular basis, there’s no benefit to emptying it.
As for your specific cases:
1. If you uninstall a program, its prefetch entry isn’t used. Because you never run the program again, the .pf file never gets read and it is normally deleted within a few weeks. No impact on performance.
2. If your system is sluggish, emptying the Prefetch folder won’t speed it up. Why would it?
I don’t really know whether or not clearing the prefetch is any good. However one thing threw me off on your original test.
To quote:
“I timed from power up, starting with the first beep (POST code) to the point where the hourglass cursor disappeared.”
Testing until the hourglass dissappears is never an accurate test. I don’t know any system that behaves exactly the same way every time I boot it up. One time the hourglass will go away after a few seconds, but the next it can take over a minute. Not only that, but you really don’t know that it was the prefetch empty that even caused boot up to be slow. There are so many peices to the puzzle during bootup. Your tests are inconclusive.
For a timed test you have to pick a common point that is always the same every bootup. When the hourglass dissappears is not a common point.
Also, sorry to double post, but here is a link from Microsoft. While not directly related to prefetch it does give a brief explanation.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xpehelp/html/xetskdisablingprefetch.asp
To quote from that link:
“Prefetch is a utility that loads commonly used applications to RAM when the system starts.”
I have no proof since my knowledge of this subject lacks. But I think a better test would be looking at the RAM after bootup to see if all your common OS and program files are loaded there. Which also explains why one site I went to recommended 512 MB of RAM to use prefetch. If all the common files are there then that pretty much blows your whole prefetch is just an index theory. Perhaps what’s in the prefetch folder is just an index, but how the OS uses that index is another thing. Because according to the people who make Windows it does a lot more than just index.
That last link is for a completely different product, Embedded Windows. That’s a specialized OS designed to go into single-purpose devices. It’s not really relevant here.
On the stopwatch testing, I’ve measured every imaginable way, and the results are consistent. Clearing the Prefetch folder does not have a positive impact on performance. As an aside, I’ll say that boot time to the disappearance of the hourglass is completely consistent on my test machines, when measured on a single computer. From one machine to the next, there would of course be different results, but a clean boot gives me identical results every time, and I wouldn’t expect random results unless I had a specialized app installed as a startup task.
I ran across this link because I was searching for additional ways to clean up cache and unwanted files. When I have doubts or am unsure I consider the size of the file and folder. I have a 40 GB HD and over 70 entries in my prefetch folder. The size of that folder is not even 5MB. With all the conflicting opinions about the prefetch folder I figure 4MB isn’t with toiling over. As a PC Tech I say, “If it ain’t broke, don’t fix it.” Besides, I like the KISS philosophy. Keep It Simple Stupid.
Personally I don’t trust third party software that does what Windows already can. I feel your better off running Windows XP disk cleanup, Defragmenter, and deleting your cookies and Temporary Internet Files.
Kev
I have been reading this thread with interest. I want to say upfront I am not a computer or PC professional. I would consider myself a literate user but thats about it. My computer has been running extremely slow recently and appears to be infected by some kind of spyware or other kind of malicous programs. On a side note, I am always amazed that talented people create such malicous software, but I digress. Whenever I shut my PC down I get a error message that states the following file IKFQDLL.EXE cannot be shut down properly. I did a search in windows explorer and this file was located in the prefetch folder. I googled this file and folder and found alot of sites telling me to delete the contents of this folder. by doing this will I eliminate this executable file from running or is it somewhere else in the PC.
Can you offer any advice on how a layperson can clean this stuff from a PC. I’ve run adaware,spybot and spware blaster to no avail.
Any help would be appreciated.
Dean