Clean Your Prefetch to Improve Performance

Reply

Join Date: Feb 2002
Posts: 12,040
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 125
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Clean Your Prefetch to Improve Performance

 
0
  #1
Mar 13th, 2004
I found this in a few different places around the 'net - hopefully it's helpful:

Clean Your Prefetch to Improve Performance

This is a unique technique for WinXP. We know that it is necessary to scrub registry and TEMP files for Win9X/ME/2000 periodically. Prefetch is a new and very useful technique in Windows XP. However, after using XP some time, the prefetch directory can get full of junk and obsolete links in the Prefetch catalog, which can slow down your computer noticeably.
  • Open C(system drive):/windows/prefetch, delete those junk and obsolete files, reboot. It is recommended that you do this every month.
Last edited by cscgal; Jun 11th, 2004 at 5:55 pm.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 25
Reputation: Mastertech is an unknown quantity at this point 
Solved Threads: 0
Mastertech Mastertech is offline Offline
Light Poster

Re: Clean Your Prefetch to Improve Performance

 
0
  #2
Jul 1st, 2006
This is actually a Myth and will reduce performance:

XP Myths
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 136
Reputation: vicec64 is an unknown quantity at this point 
Solved Threads: 1
vicec64's Avatar
vicec64 vicec64 is offline Offline
Junior Poster

Re: Clean Your Prefetch to Improve Performance

 
0
  #3
Jul 11th, 2006
Originally Posted by Mastertech
This is actually a Myth and will reduce performance:

XP Myths
Yep.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 11
Reputation: jaycckan is an unknown quantity at this point 
Solved Threads: 0
jaycckan's Avatar
jaycckan jaycckan is offline Offline
Newbie Poster

Re: Clean Your Prefetch to Improve Performance

 
0
  #4
Aug 28th, 2006
hi dani,

how to distinguish those junk and obsolete files from what files that are really needed or am i just gonna delete all the files inside the prefetch folder?

pls advise, thanks.
jaycckan

Originally Posted by cscgal View Post
I found this in a few different places around the 'net - hopefully it's helpful:

Clean Your Prefetch to Improve Performance

This is a unique technique for WinXP. We know that it is necessary to scrub registry and TEMP files for Win9X/ME/2000 periodically. Prefetch is a new and very useful technique in Windows XP. However, after using XP some time, the prefetch directory can get full of junk and obsolete links in the Prefetch catalog, which can slow down your computer noticeably.
  • Open C(system drive):/windows/prefetch, delete those junk and obsolete files, reboot. It is recommended that you do this every month.
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 25
Reputation: Mastertech is an unknown quantity at this point 
Solved Threads: 0
Mastertech Mastertech is offline Offline
Light Poster

Re: Clean Your Prefetch to Improve Performance

 
0
  #5
Aug 28th, 2006
Originally Posted by jaycckan View Post
hi dani,

how to distinguish those junk and obsolete files from what files that are really needed or am i just gonna delete all the files inside the prefetch folder?

pls advise, thanks.
jaycckan
This post by Dani is inaccurate. Obsolete entries do NOT slow your system down in ANY way. They do nothing but take up a ridiculously small amount of disk space. Do NOT clean the folder, it is self cleaning at 128 entries. I have spoken to Microsoft Engineers on the Windows Client Performance Team who have confirmed this. Please read the following link and the sources:


http://mywebpages.comcast.net/SupportCD/XPMyths.html
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 1,605
Reputation: 'Stein is on a distinguished road 
Solved Threads: 104
Team Colleague
'Stein's Avatar
'Stein 'Stein is offline Offline
Lapsed Skeptic

Re: Clean Your Prefetch to Improve Performance

 
0
  #6
Aug 28th, 2006
Yes, Mastertech is corrret on this issue.
Now if ya like the help ya could always raise our reputation...
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Clean Your Prefetch to Improve Performance

 
0
  #7
Aug 28th, 2006
I feel the need to go into detail about this....
The prefetch, is used in conjunction with Page Filing (Virtual Memory). Anybody who has spent any time with a computer, knows one simple truth. Hard-drives (even the fastest ones ever made) are still horribly slow. Regardless of what kind of drive... Raptors in raid0, SCSI, even solid state drives are the slowest part and the biggest bottle-neck of a computer system. So, there are typically only two reasons why accessing the hard-disk is done. One is when the application specifically demands it.... such as to open a file, or save the data. The second is called a hard fault. This happens when a program wants to access memory that has been written to the disk via Virtual Memory (paged), and it needs to be paged back into ram.

Programs often use dependency files, like DLL's, which contain a bunch of functions the program can use. In order for the EXE to run properly (or in some cases, even at all) the required DLL's must be loaded into memory. The Prefetcher tracks what code pages are used by an application, and the next time that application loads, it loads those pages in advance as soon as it's got some idle time, instead of waiting for a hard fault to happen when the program needs to use the DLL.

I don't personally use Page Filing (Virtual Memory) because I have enough RAM that I don't need to use my hard-drive (and take up space on it) for some extra Ram space.... consequently XP doesn't generate any prefetch files (I don't even have the prefetch folder). My point here is that prefetch has no effect (and in fact could SLOW DOWN) system performance on SOME machines. While most machines, (with default xp installations) will certainly gain speed from the prefetch, this isn't always the case.

Beyond that, on systems that use Page Filing, cleaning out the prefetch folder, will in fact, slow down system performance, because not only will XP not be able to load the required page files ahead of time, it will also take the time to write these prefetch files back to the hard-drive (the slowest part of a system). Windows also removes the .pf files after 128 of them, true. However, I've found that some file system errors have been fixed by cleaning out the prefetch.... but overall system performance will take a minor hit by removing the prefetch files.
Last edited by Comatose; Aug 28th, 2006 at 11:40 pm.
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 25
Reputation: Mastertech is an unknown quantity at this point 
Solved Threads: 0
Mastertech Mastertech is offline Offline
Light Poster

Re: Clean Your Prefetch to Improve Performance

 
0
  #8
Aug 29th, 2006
Originally Posted by Comatose View Post
Programs often use dependency files, like DLL's, which contain a bunch of functions the program can use. In order for the EXE to run properly (or in some cases, even at all) the required DLL's must be loaded into memory. The Prefetcher tracks what code pages are used by an application, and the next time that application loads, it loads those pages in advance as soon as it's got some idle time, instead of waiting for a hard fault to happen when the program needs to use the DLL.
This is not completely correct. The Prefetcher does track the first ten seconds of an application launch from a cold start of that application and then creates a Prefetch Trace file which includes a list of all the files that the application launched in those first ten seconds. Thus the second time you launch the same application from a cold start it will reference the Prefetch Trace File for that application and use the list to load all those files into memory asynchronously. By default an application would load these files in a much less optimal manner. It does not do this at system idle time. What it does do at system idle time is a second prefetch optimization: it uses the disk defragmenter to arrange all the files referenced in the prefetch trace files to the same location on the HD to further reduce disk seeks.

Originally Posted by Comatose View Post
I don't personally use Page Filing (Virtual Memory) because I have enough RAM that I don't need to use my hard-drive (and take up space on it) for some extra Ram space.... consequently XP doesn't generate any prefetch files (I don't even have the prefetch folder). My point here is that prefetch has no effect (and in fact could SLOW DOWN) system performance on SOME machines. While most machines, (with default xp installations) will certainly gain speed from the prefetch, this isn't always the case.
Virtual Memory is always in use and you cannot disable it. Disabling the Page File is a bad idea and will slow down application performance in a multitasking environment. Windows will create one even if you set the page file to disabled only it will be ridiculously small and cause alot of unnecessary paging due to the limited size. Prefetching does improve performance, why do you think Windows XP boots so much faster than 2000? How much it improves performance is based on a number of factors including the speed of your HD, how much RAM is in your system, how many applications load at startup and how large the application is that you are loading. Anyone who claims otherwise has never properly tested it. If you do not have a Prefetch folder that means you have it disabled. You can reenable it with the Prefetch Fix located here.
In no way whatsoever can Prefetching slow your system down on a properly functioning PC. Even on high end machines, prefetching will improve performance on large applications such as Adobe Photoshop and high end games but it will not reduce performance. Here is a simple test to irrefutably prove this:

Testing Boot Prefetching:

The following on a default installation of Windows will be done by Windows automatically at some point, however to confirm that the Prefetcher is enabled and Windows is optimized on a system where it might have been disabled these steps are necessary for uniformity in testing. You must be using a default install of Windows and not one that used Nlite which can permanently break the prefetcher

1. Make sure the following Services are set to Automatic:
-Task Scheduler (It is by default but many people and bad tweaking programs disable it)
-COM+ Event System

2. Make sure the following Registry Key is set to 3: (Again it is by default but many people and bad tweaking programs disable it)

Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\Memory Management\PrefetchParameters
Name: EnablePrefetcher
Type: REG_DWORD
Value: 3

3. Reboot and make sure in the \Windows\Prefetch folder the following files are present:
-NTOSBOOT-B00DFAAD.PF
-Layout.ini

4. Reboot Windows 3 more times and DO NOT install or change anything that would load during Windows Startup during any of this. This will insure that prefetching is 100% complete.

5. Download and install Bootvis. (Without using Bootvis you would have to wait 3 or more days for this optimization to happen automatically.)

6. In the menu go to "Trace", select "Next Boot and Driver Delays". A "Trace Repetitions" screen will appear, select "Ok" and Reboot. Upon reboot, BootVis will automatically start, analyze and log your system's boot process. When it's done, in the menu go to "Trace" and select "Optimize System" and Reboot. This time when your system comes up, wait until you see the "Optimizing System" box appear, continue to wait until the process is complete.

Now your Boot time is optimized and Prefetching should be properly enabled.

7. Time Windows boot with complete accuracy using Bootvis. Run another Trace and reboot. Now when Windows finishes loading the Bootvis tool you will see a time at the top of the Window that represent your optimized Boot time. Write this down.

8. Delete the contents of the \Windows\Prefetch folder. (This is never recommended except for these tests)

9. Time Windows boot again using Bootvis. Run another Trace and reboot. Now when Windows finishs loading the Bootvis tool you will see a time at the top of the Window that represent your unoptimized Boot time. Write this down.

10. Compare the times.

Anyone can easily test this themselves and see for themselves how important the Windows Prefetcher really is. Again you must be using a default non Nlite installation of Windows. Using programs like Nlite can permanently break the Windows Prefetcher.

Like I said I have personally talked to Microsoft Engineers on the Windows Client Performance Team about this and have tested it extensively. The final conclusion: Windows Prefetching is enabled by default, it is already configured optimally, it should not be disabled and the folder should not be cleaned (it is auto cleaning). Windows Prefetching only improves performance.

Don't get me wrong you can disable it and clean the folder if you want Windows to boot slower and your applications to load slower, be my guest.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Clean Your Prefetch to Improve Performance

 
0
  #9
Aug 29th, 2006
Strange.... my benchmarks show a significant improvement on system speed with page filing disabled..... I wonder why that is.... I can't imagine any time that reading to and writing from the hard-drive is going to INCREASE speed over the same information being kept in RAM....

You can read the same basic information I posted previously from Ryan Meyers, A developer on Microsoft’s Windows Client Performance Team: http://blogs.msdn.com/ryanmy/archive...25/421882.aspx
Last edited by Comatose; Aug 29th, 2006 at 12:20 am.
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 25
Reputation: Mastertech is an unknown quantity at this point 
Solved Threads: 0
Mastertech Mastertech is offline Offline
Light Poster

Re: Clean Your Prefetch to Improve Performance

 
0
  #10
Aug 29th, 2006
Originally Posted by Comatose View Post
Strange.... my benchmarks show a significant improvement on system speed with page filing disabled..... I wonder why that is.... I can't imagine any time that reading to and writing from the hard-drive is going to INCREASE speed over the same information being kept in RAM....
What benchmarks? Windows only pages when necessary it does not page just to increase disk writes.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Windows tips 'n' tweaks Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC