Search this site
Hosted by A2
Webheads love A2 Hosting because they do PHP5, MySQL5, PostgreSQL 8, cPanel, Ruby on Rails, and SSH/Shell. I use them because I like dealing with responsive, friendly human beings. Plans from $2.95/month.
Archives
Subscribe (e-mail)



Powered by FeedBlitz



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!

90 Responses to “Beware of Bogus XP Advice”

  • Andrew says:

    Kiasu,

    Something is seriously wrong with your systems if their boot time is being degraded like that. Malware infection is a possibility but you never have to reinstall the OS to correct boot issues. I’ve seen many systems where people ran useless “tweak” programs that broke the prefetcher ect… In most cases though it is simply too much software being loaded at startup. I strongly suggest using Autoruns to clear out the crap.

    Dave,

    The “defrag c: -b” Windows performs automatically at system idle times (after 10 minutes of inactivity) roughly every 3 days. It simply optimizes the location of the files located in the layout.ini. This is part of the Prefetching optimization. When you run the Bootvis “Optimize” feature it does the same thing.

  • Slick says:

    Found out about the emptying the prefetch folder to speed up the boot process.Running winxp pro,and emptied the folder.Used to take about a minute to boot up,now its about 15 seconds.Tried this twice with the same results.I know unchecking everything in msconfig speeds it up also, but something about deleting everything in the prefetch folder works also.

  • Andrew says:

    Slick,

    That is completely impossible unless you have Windows Prefetching broken in some manner or you have corrupted prefetch files, which indicates a problem with your system.

    Unchecking “everything” in Msconfig can be dangerous if you do not know what it is for.

  • Rick Sparks says:

    One startup is always different from the next (with auto updates of various components in efect) I cleen the system often, turn off auto updates (but check for them regularly). Turn on the computer and go make the coffee. I have no problem with slow Startup as long as when I am running it is fast. Rix

  • Morpheus says:

    Booting with prefetching, everything gets done much more quickly, because seek costs have been significantly reduced; high I/O efficiency comes from improvements in layout and from issuing the I/O as a single large “shopping list”:

    Instead of listening to everyone putting their “Two Cents” in and trying to weigh up all the response form the educated to the submlimely ridiculous, I chose to go straight to the horses mouth for advice, afterall these people wrote the system so one would take it they know what their doing. Guess what? its better to just leave it alone. A benchmark test was done visit for the results:
    http://www.microsoft.com/technet/prodtechnol/winxppro/evaluate/xpperf.mspx

    I will be leaving mine alone!

  • Andrew says:

    Rick,

    What you have loading at startup is irrelevant to Prefetching. Prefetching will optimize whatever it is you have loading. It also dynamically adjusts when things change. So your point is moot. What do you “clean often” because if it is the prefetch folder then you are intentionally slowing down your system each time you do it. Hey if slowing down your system is something you want to do, go right ahead.

  • grinlap says:

    Kudo to Ed Bott for such a complete treatment of this subject and for patiently answering the same questions numerous times.
    My question is, why would Microsoft put this performance enhancing feature in if it didn’t enhance performance? Historically, they’ve taken flack for long start up times. This scheme seems to have been added to improve that (and other performance issues) so I’ve got to assume it works or they wouldn’t have put it in. The burden is on those that want to take it out to prove that MS was wrong. That hasn’t happened so far as I can see.

  • Andrew says:

    grinlap, prefetching is the main reason Windows XP boots so much faster than Windows 2000. And yes you are correct.

  • elmo watkins says:

    Ok, i’m a dummy. i now realize that i should NOT have deleted the “prefetch” files. When i did this, i also deleted the layout.ini…………. how do i recreate this file and return it back to normal. i can’t even think about doing a system restore, as i have made many other changes since then that i do not want to roll back. Also, it has been more than three weeks and many reboots (more than 15) and NO “prefetch” files have been recreated. WHY, WHY, WHY!!!……… It is all so confusing.

  • Andrew says:

    Elmo,

    You disabled or broke prefetching in some way. Set the Task Scheduler to automatic and reboot, then see if the prefetch files show up, if not that means something else got changed. I recommend running the “Prefetcher Fix” file that will reset all your prefetch settings to their defaults.

    You can get that here:
    http://mywebpages.comcast.net/SupportCD/OptimizeXP.html#Tweaks