Does the /prefetch:1 argument works for any application?

9,260

The /prefetch:1 switch is basically snake oil as far as it supposedly making other applications faster to run.

What it is used for is when an application such as Windows Media Player have multiple modes that they can start up in then it is used so that their prefetch data is optimised for the particular mode that the application is starting up in. So if the applications is started with an equivalent of "/playdvd /prefetch:1" and it loads a particular set of Windows libraries then the Windows Prefetcher will generate a new profile for that particular instance of the application so that the prefetcher does not load libraries that the application was not going to ask for.

See Debunking yet another bogus Windows tip

to quote:

The /prefetch:# flag is looked at by the OS when we create the process -- however, it has one (and only one) purpose. We add the passed number to the hash. Why? WMP is a multipurpose application and may do many different things. The DLLs and code that it touches will be very different when playing a WMV than when playing a DVD, or when ripping a CD, or when listening to a Shoutcast stream, or any of the other things that WMP can do. If we only had one hash for WMP, then the prefetch would only be correct for one such use. Having incorrect prefetch data would not be a fatal error -- it'd just load pages into memory that'd never get used, and then get swapped back out to disk as soon as possible. Still, it's counterproductive. By specifying a /prefetch:# flag with a different number for each "mode" that WMP can do, each mode gets its own separate hash file, and thus we properly prefetch.

Share:
9,260

Related videos on Youtube

Diogo
Author by

Diogo

Updated on September 18, 2022

Comments

  • Diogo
    Diogo over 1 year

    I found some information about the /prefetch:1 argument on some applications, such as Microsoft Word and Excel. You add this argument to a shortcut that points to these apps.

    If I add that to the shortcuts for some non-Microsoft programs, will I get the same benefits (like startup optimization generated by prefetches)? Can Windows interpret this option for any shortcut?

  • Norio Akagi
    Norio Akagi almost 8 years
    If a certain app loads an entirely different set of dlls depending on its startup parameters (also referred to as "mode" above), adding /prefetch:n (where n is different for each "mode") will just tell prefetcher to behave like this is a separate app, which will prevent the prefetcher from loading wrong files. Theoretically, if you have such an app with noticeably different dll requirements, creating several prefetcher profiles might slightly improve performance, but the difference in the count and size of these dlls would have to be rather large to be noticeable.