Jump to content

Windows Prefetching Reference


Mastertech

Recommended Posts

Here is some reference material:

Kernel Enhancements for Windows XP

Windows XP: Kernel Improvements Create a More Robust, Powerful, and Scalable OS

Benchmarking on Windows XP

Boot Prefetching

Windows XP speeds up system boot by observing the code and data needed each time the system is booted and prefetching the necessary file contents early in the boot process. This prefetching is not done until the third boot of the system, when sufficient information is available to make the prefetching most effective. The files observed during system boot will be used in the disk layout process mentioned above.

Application-Launch Prefetching

Windows XP also uses prefetching when launching applications. The files and the contents of the files accessed by each new process are observed and recorded. No prefetching can be done for the first launch of an application, so first launches are often considerably slower than subsequent launches. About 85% to 90% of the improvement is realized after just one launch of an application, with the remaining speed improvement coming after the system has had an opportunity to adjust the disk layout with information specific to this application.

One more time: do not clean out your Prefetch folder!

Tip of the day: Don’t clean out the Prefetch folder

Debunking yet another bogus Windows tip

Beware of Bogus XP Advice

Misinformation and the The Prefetch Flag

:thumbup

Testing Prefetching At Bootup

Enable Prefetching and Test

1. Services

Task Scheduler = Automatic

COM+ Event System = Automatic

2. Registry (Using Regedit)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters

Name: EnablePrefetcher

Type: REG_DWORD

Value: 3

3. Reboot three times.

4. Download and Run BootVis. In the menu go to "Trace", select "Next Boot and Driver trace". 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.

5. Now you system is optimized for Prefetching run BootVis, go to "Trace", select "Next Boot". Record the time.

Note: You need to confirm Prefetching is working by looking in the C:\Windows\Prefetch folder. For Boot Prefetching you should see a NTOSBOOT-xxxxxxxx.pf and a layout.ini file in the folder. If not prefetching is not working. The built-in Disk Defragmenter needs to be installed and operational (nLite users) Otherwise BootVis can invoke the layout optimization. By default Windows does this every three days, for testing or anytime you want an immediate improvement, say you added or removed a startup option use BootVis and the "Optimize System" option.

Disable Prefetching and Test

1. Registry (Using Regedit)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters

Name: EnablePrefetcher

Type: REG_DWORD

Value: 0

2. Run BootVis, go to "Trace", select "Next Boot". Record the time.

Note: These steps are necessary only to confirm your system is setup to use prefetching properly and for this test. On a regular (non tweaked) XP install (not nLite) the Prefetcher is enabled by default, the two services set to automatic, the disk defragmenter is installed and the Registry Key set to 3. After three regular boots it will automatically take effect and after three days layout the files automatically and continue to do so automatically. The problem is with certain tweak programs or custom installs that break the Prefetcher. In which case the steps to enable prefetching above should get you back to normal, if all the features are there (no guarantees with an nLite install).

Other Defragmenters

Diskeeper - Does not use or touch the layout.ini file and lets prefetching work as normal. When you install Diskeeper the built-in Disk Defragmenter is still there, it is just not accessible through the GUI. The prefetcher will still use the the command line interface for the built-in Disk Defragmenter with the layout.ini file to optimize file placement for prefetching every three days. BootVis will invoke it whenever you want.

PerfectDisk - "If PerfectDisk is set to manage the boot/layout files, then PerfectDisk will disable the "partial" defrag that Windows XP is doing approx every 3 days and PerfectDisk will make sure that the files needed for boot (default configuration) as well as the files indicated in the layout.ini file are "optimized" (if configured). PerfectDisk will make sure that these files are contiguous and place these files at the top of the logical partition. All PerfectDisk is doing is using the information regarding boot and application launches that Windows XP has gathered. This information can either be gathered over time by Windows XP itself or gathered by running BootVis once." Prefetching still needs to be enabled and a layout.ini file present.

Edited by Mastertech
Link to comment
Share on other sites


They just keep on deleting threads dont they XD

Anyway did u read my last post in the thread? about my m8 saying to switch the prefetcher=0 after u launched all games and applications. That way u dont have the cachemanager checkin stuff to prefetch during boot = fast boot. But traces are used because the using of traces is always on.

Link to comment
Share on other sites

Yes but that is not true though, Enabling the Prefetcher (it is by default) in no way slows down booting. I tested it, on my test system with Prefetch = 3 it boots in 41 seconds. With Prefetch = 0 it takes 90 seconds.

Think about it this way. One of the big goals of XP was a faster boot, why would they have a feature that degrades boot time performance over time? Not only does it not degrade performance but it makes no sense.

Link to comment
Share on other sites

how big is ur installed xp? coss I have an nLited of 200mb and boot starting from the first sign of the windows logo is like 20sec. And I just have a athlon xp 2400+ with a sata drive...

not a 3.4ghz intel with a 10.000rpm disk

So u have or a bigger windows, or slower pc.... ooorrr u leave in task schedular, coss it contains the prefetch component.. so maybe when I dont use task schedular.. I scrape like 10sec of boottime. Can you test disabling taskschedular and event log?

Link to comment
Share on other sites

I have a full XP install. To get very accurate boot timings use Bootvis. Part of the problem is what people consider finished loading. Bootvis will eliminate any of these errors. Task Scheduler has to be on for the Prefetcher to work properly.

Link to comment
Share on other sites

EDIT! THIS TEST IS FLAWED

It has been confirmed that my Prefetch was not fully working, no smart placement of files to be loaded on the harddrive, this renders my test invalid and worthless, as it tells nothing about how Prefetch could help a working system with boot time.

Prefetch still seems to work for applications and bootfiles loading though, worth to note. Except the smart placement that is.

EDIT! THIS TEST IS FLAWED

I've started my testings now, although I won't use bootvis, it's not on Microsofts homepage any longer and thus I won't use it.

Instead I'm timing from when I choose Windows XP in the bootloader to where all the icons in the systray are loaded, and the IDE-lamp has stopped with its constant glow. It might not be as accurate as bootvis but the differences should nevertheless be seen.

I've started first to measure my boot times as they are, with Prefetch on and the cache that has been gathered since the install of Windows. Those times are:

1: 42.8s

2: 42.6s

3: 42.6s

4: 42.7s

5: 42.6s

Average: ~42.66s

I'm now moving on to where I disable Prefetch in the registry, but I don't touch the cache itself.

Those times are:

1: 42.0s

2: 41.9s

3: 41.7s

4: 41.7s

5: 41.9s

Average: ~41.84s

Observations so far: After disabling Prefetch in the registry I was left with a boot time 0.82s faster than with Prefetch enabled. This was without cleaning the cache, but I already now guess that it will have no affect on the result as I noticed that all the "symptoms" of prefetch being used was gone, that is that green progress bar going several times instead of not even one, and that programs once logged in took much longer time to load. I took notice to the time of just when I was past the classic login box that without prefetch the clock was at almost exactly 20s there, whereas as I can remember with prefetch it was around 30+, can't say for sure so I'll check that again later on. Still the times are almost the same, and I guess that if I would have started Firefox or Foobar in the situation where prefetch were disabled I would have had longer loading times than with prefetch on. I'll make a proper test of this later on, but I guess that what little time I've saved by disabling prefetch I have to give away again by longer loading times on my other applications.

Anyway, onwards to the test where I clean the Prefetch-folder.

Those times are:

1: 41.6s

2: 41.2s

3: 41.9s

4: 41.7s

5: 42.0s

Average: ~41.68s

As far as I can tell I was right about that the cache wasn't used when Prefetch was disabled in the register, the little speeddifference (avg. 0.16s) is better explained with more or less exact reactions from the tester in question, than any real speed difference. But my conclusions this far is that disabling Prefetch can, atleast in the case of my setup, shave of a little time from ones boot time. But I also tested to launch Firefox without and with Prefetch on (and the cache restored after I removed it).

FF w/o Prefetch and no cache: 7.2s

FF w Prefetch and cache: 6.3s

Almost a seconds difference there. I should of course run som more tests to be more sure, but that was just one application of many, and if that applies to all my programs then I rather use Prefetch, because what I earned in disabling it I loose with just one application.

Results:

Prefetch ON: 42.66s

Prefetch OFF: 41.84s

Diff: 0.82s gained.

Prefetch ON: 42.66s

Prefetch OFF, no cache: 41.68s

Diff: 0.98s gained (?).

If you're unhappy about my test or/and the results, I suggest you do some testings yourself. I will continue to use Prefetch, I rather have my apps start faster than my Windows.

Oh, just realized this means nothing if I don't write what kind of system I was testing it on :P Well, here it goes, with a little help of Everest.

PS: Its an 2500+(1.83Ghz) overclocked to 2200Mhz, not 3200+ original.

Computer:

Operating System Microsoft Windows XP Professional

OS Service Pack Service Pack 2

DirectX 4.09.00.0904 (DirectX 9.0c)

Computer Name ANDREAS

User Name Andreas

Motherboard:

CPU Type AMD Athlon XP, 2200 MHz (11 x 200) 3200+

Motherboard Name Asus A7N8X v2.0 Deluxe (5 PCI, 1 AGP Pro, 3 DDR DIMM, Dual LAN, IEEE-1394)

Motherboard Chipset nVIDIA nForce2 Ultra 400

System Memory 1280 MB (PC3200 DDR SDRAM)

BIOS Type Award (08/04/04)

CPU Properties:

CPU Type AMD Athlon XP 3200+

CPU Alias Barton

CPU Stepping A2

CPUID CPU Name AMD Athlon XP 3200+

CPUID Revision 000006A0h

CPU Speed:

CPU Clock 2204.56 MHz

CPU Multiplier 11.0x

CPU FSB 200.41 MHz

Memory Bus 200.41 MHz

Chipset Properties:

Motherboard Chipset nVIDIA nForce2 Ultra 400

Memory Timings 2.5-3-3-11 (CL-RCD-RP-RAS)

Command Rate (CR) 1T

My Session.ini is attached.

Other registry tweaks applied:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]

"NtfsDisable8dot3NameCreation"=dword:00000001

"NtfsDisableLastAccessUpdate"=dword:00000001

"Win95TruncatedExtensions"=dword:00000001

"Win31FileSystem"=dword:00000000

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]

"NoNetCrawling"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]

"NoRemoteRecursiveEvents"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WOW]

"DefaultSeparateVDM"="Yes"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BrowseNewProcess]

"BrowseNewProcess"="Yes"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ContentIndex]

"FilterFilesWithUnknownExtensions"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]

"DesktopProcess"=dword:00000001

Services running:

services_running.gif

Programs autostarting:

startup.gif

EDIT! THIS TEST IS FLAWED

Last_Session.ini

Edited by Ibis
Link to comment
Share on other sites

I would say give him a chance as long as he doesnt result to constant badgering to people with opising views

and stops the name calling and has an open mind. Most people here are not running out-of-the-box OS. Some are modified a little and others are modified a lot and all in between.

We will listen to you as long as you listen to us, and keep it civil Deal ;)

Edited by dirtwarrior
Link to comment
Share on other sites

please move thread where it should be

windows xp section.

Yes but that is not true though, Enabling the Prefetcher (it is by default) in no way slows down booting. I tested it, on my test system with Prefetch = 3 it boots in 41 seconds. With Prefetch = 0 it takes 90 seconds.

Think about it this way. One of the big goals of XP was a faster boot, why would they have a feature that degrades boot time performance over time? Not only does it not degrade performance but it makes no sense.

cause you use norton AV

for most of us, using the good software, and dont have a million things loading @ startup. this means nothing.

I would like to see a screenshot of bootvis to prove these acuzations.

where i can see your taskbar.

Edited by gdogg
Link to comment
Share on other sites

Mastertech, you indeed have probably a whole gigantic start up load .. coss if ibis disables prefetch, he has 1sec speed profit.. and he prolly has quite a few systray apz as well.. I just have 1 systray app.. kaspersky :D

thats it.

Btw, I will have a test pc at work around monday/tuesday. So I will start testing then, n give results to nuhi so he maybe can build in some prefetch advice in nLite, coss afterall. nlite is about speed n stripping useless stuff.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...