Prefetch
Windows Vista's SuperFetch builds on a technology introduced in Windows XP called Prefetch, so let's talk a little bit about it as well before we move on to SuperFetch and EMD. To begin with, prefetching is a process in which the operating system loads key pieces of data and code from disk into memory before it's actually needed. With this in mind, let's take a general look at how prefetching works.
In order for this prefetching operation to actually improve performance, the Windows XP Cache Manager monitors the data being moved between the disk and RAM and between RAM and virtual memory when the system is booting up as well as when various applications are loaded. As the Cache Manager monitors these occurrences, it constructs maps of the directories and all of the files that were referenced for each application or process. These maps are then saved to files with a .pf extension in the \Windows\Prefetch folder.
Once these map files have been created, the Cache Manager will use them to improve efficiency when the system boots up as well as when loading applications. More specifically, the Cache Manager will intercept every process or application that is about to be loaded and will check the \Windows\Prefetch folder to see if there is a corresponding map. If there is, the Cache Manager will call on the file system to immediately access the directory and files referenced in the map. The Cache Manager will then alert the Memory Manager and tell it to use the information in the map file to load data and code into memory. Once this prefetch operation is complete, the Cache Manager will allow the application or process to continue loading. As the application or process does so, it will find the majority of the files and data that it needs already available in memory, thus reducing the amount of disk access and allowing the application or process to load or respond faster.
In order to further improve the efficiency of this prefetching operation, Windows XP will regularly analyze the contents of the map files, compile a list of the directories and files, organize them in the order in which they are loaded, and save this information in a file called Layout.ini in the \Windows\Prefetch folder. It will then schedule disk defragmenter to run on a regular basis and use the information in the Layout.ini file to relocate all of the directories and files listed to a contiguous area of the disk.
SuperFetch
Now that you know how Windows XP's Prefetch technology works, you have a good idea of how about 70 percent of Windows Vista's SuperFetch technology works. As the next version of Windows XP's Prefetch, SuperFetch does everything that Prefetch does and more.
To begin with, SuperFetch overcomes one of the big drawbacks in Windows XP's Prefetch technology. As I've explained, Prefetch improves efficiency by loading the majority of the files and data needed by an application or process into memory so that they can be accessed very quickly when needed. However, because these files and data exist in memory, they are subject to the laws governing virtual memory. In other words, when other applications need access to memory, any prefetched data is moved out to the page file on the hard disk. When it is needed again, it then must be moved back from the page file to memory, which of course offsets the performance enhancement.
SuperFetch goes one step further to ensure that you get the most out of the performance enhancement. In addition to constructing the map files I described earlier, SuperFetch also constructs profiles of the applications you use that include information about how often and when you use them. SuperFetch then will keep track of the applications in your profile and note when any prefetched data is moved out to the page file. SuperFetch will then monitor the progress of the application that caused the prefetched data to be moved out to the page file and, as soon as that application is done, it will pull the prefetched data back into memory. So when you go to access the application, the prefetched data will again be available in memory and the application will be very responsive.