Geek Project: Speed up Windows Boot Time by Tweaking the Windows Prefetch Cache!
[NOTE: the tweak outlined in this post has been called into serious question. It seems that it has been circulating around geek sites for a LONG time, and that there is a question as to whether it is valid. There seem to be good arguments FOR and AGAINST… as with any recommendation, I tried it myself and reported my findings… which appeared to be that it worked for me… BUT, YMMV (Your Mileage My Vary)… and, it is very possible that there were other factors that caused my apparent boot time speedup (from a minute to 30 seconds.) Now, 50% better is pretty impressive… but it could have been the result of other factors rather than the registry setting itself. I suggest that you read all of Andrew’s comments following this post… check out the sites he points to… and make up your own mind, based on the points made. I DO try and keep this a “fair and balanced” guide to user helpful hints… and now back to your regular reading….]
Original Post Starts Here:
Everyone wants a faster Windows boot time, huh? Well, here’s a cool tip! Clean out your Windows Prefetch Cache! A Geek Project for you!
In Windows Explorer, navigate to C:\Windows\Prefetch
Once there, delete everything under the “Prefetch” directory. (DO THIS AT YOUR OWN RISK! I ain’t responsible! REALLY!)
Now, reboot your system. This reboot will be very slow, because it will be “rebuilding” the system’s prefetch cache again. This is because Windows needs to “relearn” the prefetch for it’s system files. Subsequent boots will be MUCH faster! However, the Winodws Prefetch cache will soon “fill up” again as you use the system and it’s applications. Sooooo… let’s keep that from happening!
We will need to edit a registry key to fix that. (If you aren’t comfortable editing the Windows Registry, don’t do it… call your friendly local geek and show him this article!) If you are “down wit'” doin’ it… go for it! Open Regedit and browse to this Registry Key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters
Under this key you should see a value named: EnablePrefetcher
It has 4 possible values:
0 – Disabled : The prefetch system is turned off.
1 – Application : The prefetch only caches applications.
2 – Boot : The prefetch only caches boot system files.
3 – All : The prefetch caches boot, and application files.
Now, keep in mind, we don’t want to disable the prefetch entirely! This would actually make system boot times much longer! This is because this feature is used to speed up the loading of Windows boot files. So, let’s pick the number 2 option. It allows us to keep the advantage of caching Windows system files, without filling up the prefetch with application data.
Set the value to 2 and reboot your system. The next time that you boot it will be MUCH faster! Cool, huh? So, do this and, like me, you could do from over a minute in Windows boot time to 30 seconds! Very, very cool! You can also defrag your hard drive… that will help too!
This is not how Prefetching works. The original author you got this from has no concept of how Windows Prefetching works. Both of these settings will SLOW DOWN your system and are Myths. Anyone who claims otherwise has never properly tested or timed this. Please read the following and all the sources:
http://mywebpages.comcast.net/SupportCD/XPMyths.html
Cool! Controversy! I love it. So, in my podcast, when I said that my boot time went from 1 minute to 30 seconds, that was wrong? Fascinating! And, if M$ made the “2” setting available and explained that it “prefetched” only the boot files, that was wrong? Why have “2” then? Anyway, as usual, Windows “tweaking” is “religious”… what works for you, works… or it doesn’t. “Your Mileage May Vary” (YMMV)… so if you don’t wanna do it… don’t! If you want to experiment, and it does work for you… great! (I am SO easy goin’!)
Your improvement in Boot time had nothing to do with changing the setting to 2 or clearing out the prefetch folder. Windows will boot in the exact same amount of time with 2 or 3. And clearing the prefetch folder will only SLOWDOWN your boot times.
You copied this from another article which recommended some other boot optimizations some would have an effect. I am assuming you attributed it to this setting. You cannot apply ten tweaks and then just declare them all effective. You need to test each one individually. You obviously never did that with this tweak.
Now the only way this could have worked is if the EnablePrefetcher value was set to 0 or 1 (both disable boot prefetching) Thus by changing it to 2 you ENABLED Boot Prefetching. From the difference in Boot times you posted (if accurate) that would make the most sense. Setting it to 3 would have the exact same effect. which is the default and optimal value. With 3 you also accelerate your application loads and these are NOT precached at startup and 3 has ABSOLUTELY NO NEGATIVE EFFECT ON BOOT TIME. That article by IntelliAdmin has caused widespread ignorance around the internet about the Windows XP Prefetcher and the correct settings.
There is no controversy on this, there is only how it works. I have personally spoken the Engineers on the Microsoft Client Performance Team about this who have confirmed everything I am telling you.
There is plenty of documentation on this and proper testing can confirm what I am saying. Here is some reference material:
Misinformation and the The Prefetch Flag – Ryan Myers Microsoft Windows Client Performance Team
http://blogs.msdn.com/ryanmy/archive/2005/05/25/421882.aspx
Windows XP: Kernel Improvements Create a More Robust, Powerful, and Scalable OS
http://msdn.microsoft.com/msdnmag/issues/01/12/XPKernel/default.aspx
Kernel Enhancements for Windows XP
http://www.microsoft.com/whdc/driver/kernel/xp_kernel.mspx
Benchmarking on Windows XP
http://www.microsoft.com/whdc/system/sysperf/benchmark.mspx
Windows XP Performance
http://www.microsoft.com/technet/prodtechnol/winxppro/evaluate/xpperf.mspx
Windows XP Professional Resource Kit
http://www.microsoft.com/technet/prodtechnol/winxppro/reskit/c28621675.mspx
It is IMPOSSIBLE for this to work as you claimed.
OK… it seems Andrew is on a personal “mission from God” to correct the urban legend of the prefetch cache. Man! I can picture you scouring the ‘net looking for anyone that posts this with the glee of correcting the idiots that post it. Yeesh! Anyway, I HAVE found that this is very, VERY controversial… there are posts that would seem to support both positions on various well respected performance geek sites. People report (like me) that it DID actually seem to boost boot time… BUT, was it really due to the registry setting… or, was it because of clearing out the prefetch directory that MIGHT have had prefetch files there that are no longer needed to be there… from programs that have been un-installed, and deleted? I don’t know. My experience was real… but it appears that the registry setting could be bogus. However, I did find this link from Microsoft’s site about Windows XP EMBEDDED that states the purpose for the various numbers:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xpehelp/html/xetskdisablingprefetch.asp
Again, this is EMBEDDED not “regular” XP, or XP Pro… so who knows. I will amend the post to clarify the “hint” as being what it appears to be… a tremendous geek controversy. Wow.
uh… no. Look I realize you don’t understand how this works many people do not. Please STOP guessing and read the links I posted. Please don’t attempt to insult my intelligence about this. I have wasted enough of my time trying to help people from SLOWING DOWN their system. Clearing the Prefetch Folder will REDUCE Boot times. Unused entries in the Prefetch Folder do nothing but take up disk space. They in NO WAY effect WINDOWS boot time. The Prefetch folder is automatically cleaned after 128 entries. When Windows XP Boots is references two files in the Prefetch folder:
NTOSBOOT-B00DFAAD.PF
Layout.ini
Your comment on this only proves you didn’t read a thing I posted.
The other Prefetch Trace (.pf) files are only REFERENCED AFTER you initiate an application load. They are there to optimize it how it loads so it loads as quickly as possible. The application trace files will not be created if you set it to two.
Here are more Links:
EXPERTS:
Ryan Myers – Windows Client Performance Team
Misinformation and the The Prefetch Flag
http://blogs.msdn.com/ryanmy/archive/2005/05/25/421882.aspx
Ed Bott – Author Widows XP Inside Out
One more time: do not clean out your Prefetch folder!
http://www.edbott.com/weblog/archives/000743.html
Beware of Bogus XP Advice
http://www.edbott.com/weblog/archives/000024.html
Tip of the day: Don’t clean out the Prefetch folder
http://www.edbott.com/weblog/archives/000619.html
Mark Russinovich – Author Windows Internals
http://www.microsoft.com/MSPress/books/6710.asp
There is not “controversy” on this. There is Microsoft and RESPECTED Windows Experts. Do you remember the Sony Rootkit Controversy? Mark Russinovich was the one who found it. He wrote the initial MSDN article explaining prefetching:
http://msdn.microsoft.com/msdnmag/issues/01/12/XPKernel/default.aspx
Ryan Myers WORKS FOR MICROSOFT! He is an engineer on the Windows Client Performance Team. Do you think he knows what he is talking about?
I realize you think this is some sort of a joke but anyone who is trying to optimize their system and follows this incorrect advice only to find out they later made their system SLOWER will be pissed. Say you have a large game that loads in under 2 minutes and now takes over 5 minutes because of following the advice you posted. You think they would be happy? Maybe you don’t care but I do.
This article about Windows XP Pro and Home also covers the EnablePrefetcher Value:
http://www.microsoft.com/whdc/driver/kernel/xp_kernel.mspx
Simply cleaning the Prefetch Folder will REDUCE PERFORMANCE (longer load times Windows + all Applications). Setting the Registry Value to 2 will cripple all Application Load times.
OK… a few minor points, and then, I believe, we can end the “back and forth” on this one:
A) I DO care that we present good information to our readers on “Dr. Bill -The Computer Curmudgeon.” And, if, in retrospect, I am wrong, then I am wrong. That’s OK, I have over 27 years in the computer industry and I am long past needing to prove anything. Maybe that’s why I am a curmudgeon.
B) I do try and present any information on the Blog in a humorous and/or “tongue-in-cheek” tone, because that’s my style… sorry if that offends anyone. Offense is not what I intend.
C) It is true, I did not read ALL your links… and perhaps I should have… OK, I admit it. Confession is good for the soul. I did read several, and searched on the issue throughout many web sites, and found various statements both ways, as I said. That is why I said that there appeared to be “controversy.” Controversies do not imply that there is no actual “right or wrong,” just that there are many opposing viewpoints. In fact, there are many “controversial” things that are based in issues that DO have a true “rightness” about them… if that makes sense.
D) I defer to you, Mark Russinovich, and Ryan Myers… I am changing the value in my registry after I type this comment.
Everyone, listen closely… change your value back… and now, I back slowly and quietly out of the room.
Three words for ya: “Windows is stupid.” There ya go. I just took all those experts and shoved them down the drain since my linux laptop with old hardware boots in 30 seconds. :p
If you actually read the Windows XP Kernel Improvements on “prefetch”, it defines.. wait for it… “prefetching“. Whoa. what a concept. In reality, there’s not too much you can do with Windows bootup or performance management except for turning off services, and tweaking the pagefile settings. There’s a couple others that I do on my work laptop, but all in all. You’re never going to get the 10 second boot. Mainly because the way Windows is written, it’s more important to show you the GUI and pretty screen before you can do something, than actually let you do something. That’s why network comes up as one of the last loaded even if you’re starting to launch applications. It’s stupid, but blame XP kernel dev team. If you’ve never tried it: try launching a network app like putty right when it boots. I bet dhcp still hasn’t loaded when you try it.
Darkmoon,
If you think there is not much that can be done compare how long Windows 2000 loads and then XP. The reason XP loads so much faster is due to thats right – Prefetching which is a new feature of XP. As an example a PC would boot up in under 29 seconds with it enabled (it is enabled by default), with it disabled the same machine took over 1 minute and 20 seconds. Prefetching works.
Yes disabling services will improve boot times but you need to make sure not to disable the Task Scheduler, which the Prefetcher uses to create the Prefetch trace files, layout.ini and schedule the defragmenter to further optimize the files referenced in the layout.ini.
Tweaking the pagefile settings in no way improves boot times unless of course you set it smaller than the default and then Windows will take LONGER to load.
How fast you will get Windows to boot depends on MANY things such as how many applications, drivers and services you have loading at boot up, how fast your HD and CPU are, the fragmentation level of the HD and how much RAM you have. Thus there is no one set time you can achieve with every computer. The absolute fastest machine available should be able to achieve under 10 seconds with the proper optimization.
Yes, its working…… my system used to take 5 minutes for booting up (why I dont know) but now it is taking only 1-2 minutes.
Thankssssss
SHEESH, just use Linux, then you won’t have this problem at all eh?? ;-))