Saturday, November 14, 2015

Purging Prefetch Files For Under-performance Improvement!

There is a lot of material published that suggests purging your Windows prefetch files is a standard order of operation for "cleaning" your system of chaff. The sages say that by purging them, you will free up all that space for new prefetch files which will be up-to-date, and will no longer include old prefetch data that your system no longer uses. They will tell you that the prefetch files get regenerated the next time you use the application the prefetch file was associated with. A considerable number of un-used prefetch files may in fact be preventing currently used applications from gaining a prefetch file in your Windows system.

All of this is good information, and true, and I will be the last to suggest that it is counter productive. By far, most people that purge their prefetch files tend to benefit from it.

But there are pro-purge-prefetch phrases that are a bit too flabby that should give anyone pause when they read them.

- That the system recreates them "anyway".
- That no harm is done by purging them.
- That it will improve performance.

These ways of discussing prefetch files have a bit too much finality to them. But I wont cry because I know that many people benefit from these tips, as proffered.

Yet there are instances wherein purging prefetch files is not only counter productive, but is doubly counter productive and damaging to system performance. It may not happen to many, and I am not going to provide any definitive proofs here (Welcome cat callers!) But these occasions can and do exist, and they aren't one-in-a-million occasions. Odds are, some readers will stumble on this long after they have been immolating their machine's potential.

While I will discuss such an instance here regarding a specific program, I am sure there are similar situations that occur for other programs. If you are someone in a similar situation or think you may be, purging prefetch files may not be a "simple operation" that has "enhanced performance". At least, not if you want to enjoy better computer performance. For those of you that think you may be such a person, I will say one thing:

Keep searching, and keep reading until you know you have found an answer!

One application I am very fond of is a disk defragmentation program called MyDefrag. Amoung it's characteristics that endear users to it is it's use of Window prefetch data files. MyDefrag doubles-down on the performance-enhancing benefits of Windows prefetch data. Windows will use prefetch files to improve file access for frequently accessed processes. So too does MyDefrag by elevating priority of files referenced in Windows prefetch files. It gives these files improved placement on the hard drive.

As the sages say, if these files are sorely out-dated and no longer referenced by Windows, they just occupy space and serve no purpose. But for MyDefrag users, they are a critical part of the defragmentation and file-placement process. So it is a natural process for a MyDefrag user to keep any and all prefetch data if it is of any substance, especially when "cleaning the system" before a defrag operation.

For a MyDefrag user, pruning un-used prefetch files while keeping those prefetch files in use by Windows is a wise thing to be doing. It involves manually inspecting them, comparing older to newer copies, and pruning based on merit - not a wholesale clean sweep of all prefetch files. To a MyDefrag user, purging them all is equivalent to instructing MyDefrag to "undo all the performance enhancement you have done by no longer processing any prefetch data". That is literally the instruction given! MyDefrag will not have any prefetch files to deal with, and thus, no benefit will come of whatever valid prefetch data was lost to purging.

This happens to a lot of MyDefrag users, I suspect. Dozens of programs are developed under the sage guidance of purging all prefetch data. Some do not even ask you or allow you to do otherwise. They just purge it all, and tell you "Hey! I just did you a world of good!"

So before you swallow the purge prefetch mantra/fetishism, be aware it isn't all Pravda. For most, it is. But not all. To me, the mantra is in sore need of a big, fat Sticky note attached to it. "Good advice, except when it bites you in the ass!"

For MyDefrag users, there are additional considerations. If all you do is keep prefetch data and run MyDefrag, chances are, you may be doing some counter productive things with your prefetch files. You can be forgiven for this since there seems precious little you can do with prefetch data. For most of us, the files are "there" or "not there". What else could possibly be done with them?

Windows will continually update valid (in use) prefetch files. As part of the prefetch maintenance process, its a double-edged service performed that cuts two ways.

If you have a video editor such as VirtualDub, and import and export a lot of video and audio data into it, the files you used most recently will feature prominently in your VirtualDub prefetch file. This is all part of what Windows does with prefetch data, and it keeps it current with your patterns of system, process, and file usage.

For someone defragmenting a hard drive in MyDefrag, these media file references appearing in their prefetch file data for VirtualDub will be counter productive. MyDefrag will elevate the priority of VirtualDub and give its executable and files pride of placement on the hard drive. But then, it extends this to the media files!

Example: You wanted to snip out a scene from your favourite movie - an 8GB video extraction you performed on your own, just to secure that ten second clip! Aren't you a clever boy!

Now with that movie still idling in the temp folder you made for it, MyDefrag pushes this huge 8 gigabyte file up to the front of your hard drive. When you reboot your system subsequently, you may find yourself wondering why the system wasn't up and atom as spritely as it was last time! Or why your other video editing suite is taking longer to load. Your movie file gained priority, especially because it may be one of the most recently accessed and created files on the system, and because it showed up in a prefetch file!

The way around this issue of prefetch files that get updated is quite simple. It may involve a total purging of the Windows Prefetch folder! In fact, it will involve a purge, but with a twist.

Instead of purging the Prefetch folder of it's content, create a sub-folder in your Prefetch folder named "Pristine". Create a second sub-folder named "Updated". Once you understand the process, you can rename these folders to whatever seems most apt to you. These are the names I use for the folders, whose purposes I describe below.

Go through the Prefetch folder and winnow out any un-used prefetch files. If Windows is not using them, neither is MyDefrag. If no other program is, then delete them. This should leave you with a host of well maintained prefetch files which are currently helping improve matters with Windows. Select all the prefetch files, and push them into the "Updated" folder. This will leave you with an empty Prefetch folder (or possibly an ini file or two).

Now that you have a clean prefetch slate (Windows has nothing to update), it is time to begin creating new, application-specific prefetch files that have no file references to files that are not part of the application itself! Now that Windows has no prefetch files to deal with, you should purposely set out to create prefetch files for each of your applications. It is important to do so without involving any other files in the launch process.

ie: Do not double-click on an image file, causing your image editing application to load the image. The prefetch file that gets created in this instance will have a reference to the image itself, and that is what you want to avoid (for MyDefrag's sake). Creating prefetch files in this way insures that only the application and its libraries and such benefit from the prefetch file, and that means you have to launch the application by itself. Try the shortcut to it, or just go through the Program Files folder launching those applications you actually care about. Yes, my Internet Explorer has no prefetch file.

The same time you are launching these applications in the manner described, you should be creating copies of them and placing them in the "Pristine" sub-folder within the Prefetch folder. This is important because it will stop Windows from updating these copies of the file.

Once you have created all the prefetch files you could ever care about in a pristine state, and safe from Windows, you can resume using Windows normally. You can restore any of the prefetch files from "Updated" back to the Windows folder, or just leave copies of the newly created prefetch files in there (this is easiest).

Any new applications you acquire and install should also get the same pristine-prefetch treatment. You also must to do this whenever any existing application is updated (and off the old file). This may be hard to do if your machine is automatically updating software (most are). In these instances, you will need to make a habit of visiting the Prefetch folder, sorting by date, and inspecting the new crop of prefetch files that get created by Windows, and again, making pristine copies of them.

The payoff for all this excess work is having a Pristine folder chock full of every application on the system. A folder whose contents you can copy into the Prefetch folder, overwriting existing files and/or replacing them after you have manually deleted/moved the updated files out of the way. Moreover, you can have as many application prefetch files as you like. Whether or not Windows uses them, MyDefrag will when it finds them in the Prefetch folder!

With a Windows Prefetch folder full of pristine prefetch files, you can then begin the process of defragging the hard drive with MyDefrag, confident in the knowledge that no big, fat media files, or ridiculous series of MP3s and such get top placement on the hard drive. The only files that will get priority are you applications themselves, Windows own series of processes and data files, and anything else you have ear-marked for special treatment in your .MyD files. The resulting defragment operations will do more of what you want, and less of what you do not want. And your system will love you for it.

All the same, keep nodding to the sages. More often than not, they have good advice. Usually!

Also grab a helpful tool: WinPrefetchView. Nir Sofer's Prefetch viewing tool is a perfect accompaniment to anyone interrogating prefetch files. See what is in them, and do what you will with what you discover.

No comments:

Post a Comment