Home arrow Windows Help arrow Prefetching 2

Prefetching 2

If you've read our Prefetching article, you'll realize there's a lot of bad advice out there about prefetching. Well, there's actually more. There's bad advice out thereabout the /prefetch switch.

Windows puts /prefetch:[number] on media player links, where number is between 1 and higher number, depending on the link. Some places say to put it on all your links, some places say that's a media player only option, and they're both completely wrong.

/prefetch:[num] is  easy to understand if you understand prefetching. Basically, /prefetch:1 is counted as a different program than /prefetch:2, and so on, for the purposes of prefetching. I.e., if you've been running a program with /prefetch:1 and it has prefetch info, and you run it with /prefetch:2, Windows will not recognize the existing prefetch information and create new information, which it will then use every time you run that program with /prefetch:2. It will continue to use the /prefetch:1 information for /prefetch:1 launches of that program. (We suspect that leaving off a /prefetch counts as /prefetch:0, but cannot prove this.)

At this point, most of you are wondering what the heck the point of that is. All it does is make things more inefficient. Well, there are certain programs, and Windows Media Player is one of them, that have almost entirely different pathes of execution on program startup depending on how you launch them (via command line options), which results in them wanting different memory pages, and thus, ideally they'd have different prefetch files for each  different command line option. This what the /prefetch options on WMP are for.

/prefetch is totally useless unless you have one program with two or more different ways of launching it, and you suspect that each different way of launching results in different pages getting loaded during startup. The only example out there I can think of besides WMP is something like Google Earth, which gives you links to run it in OpenGL or DirectX mode. Those modes are probably different enough that different prefetching on each would help it out. (Although why you'd be using both is beyond us.)

 I.e., /prefetch probably completely useless to everyone out there. It could be slightly useful to programmers that are writing programs that start in different modes, but that's about it. OTOH, at least this advice isn't actively harmful like cleaning out your prefetch folder.