Monday, November 19, 2007

Benchmarks*: Windows XP Disk Defragmenter

The first benchmark results are for the built-in Windows XP Disk Defragmeter (WDD). This composite image shows the "before" and "after" file layout of the test system. The defrag program was run numerous times between these two results, so don't expect to achieve this in one pass, or even in one day.
This graph shows the results in a more accessible form. The first test is at the bottom, and shorter lines mean faster times.
  • "Basic XP" refers to the standard install, without Office 2007, so there are only 710 files to be tested.
  • "WDD" refers to the read times of the same 802 files, after several defrag passes using the WDD Defrag button. A 26% performance improvement is measured. You could expect this result on a "clean" install machine.
  • "Basic Office" refers to the read time of all 802 test files, where no defragmentation has been done whatsoever, before or after the installation of Microsoft Office 2007 Professional.
  • "Full WDD" refers to the read time of all 802 test files after several reboots and several passes using the WDD defrag button. A 28% performance improvement has been measured.
  • "Auto" is an interesting result. The system was left without any defragmentation, but rebooted once or twice a day for 6 days. This was done by changing the date on the laptop, and allowing several hours between each reboot.
The only difference between the "Auto" and "Full WDD" is a change in one of the Windows registry values (the default is 0):
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft
\Windows\CurrentVersion\OptimalLayout]

"EnableAutoLayout"=1
You can set this using a simple registry file, or by using the "UnityPro Disk Idle Optimiser" program. This registry entry causes Windows XP to optimise the layout of regularly used program and system files only, not data, so it isn't quite the same as an automatic defrag. Also make sure the following registry key is set (the default is "Y")
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft
\Dfrg\BootOptimizeFunction]

"Enable"="Y"
Conclusion: WDD can reduce program load times by around 27% compared to a badly maintained system. Scheduling a regular defrag (once a month for low-usage systems) will help prevent the system from experiencing major slowdowns caused by file fragmentation. if your system starts getting sluggish, try running WDD's Defrag manually. Also use a program like CCleaner to clean out junk from your system. Another useful option is the undocumented "defrag c: -b" command, which is supposed to do the boot optimize on demand.

2 comments:

Anonymous said...

Before benchmarking, you should also boot to Safe Mode (command prompt) and run defrag (assuming drive C: for Windows) as follows:

defrag c -b

This is a hidden switch for the Windows XP defragger that will force a rearrangement of the critical system files based on the layout.ini file in order to speed up boot time.

Donn Edwards said...

Thanks for the info! This is most useful.

I used the command
rundll32.exe advapi32.dll,ProcessIdleTasks
which hopefully after 3 reboots will have achieved the same effect. I also moved the date forward by 4 days before the final reboot in order to force the "regular" defrag.

I will experiment with the -b option and see if it affects the results in any substantial way.