Of everything you can do to optimize Windows XP, one of the simplest is just to use it. As you launch and exploit applications, Windows observes your behavior and updates a dynamic file called Layout.ini. After every three days, when it senses that the computer is idle, it rearranges the locations of programs on the system hard drive to optimize their launch and execution.
XP also speeds up and the boot process and optimizes the launch of programs by using prefetching. Windows observes the code and programs that are used immediately upon bootup and creates a list of data to prefetch very early in the boot process. Similarly, as individual programs are launched, Windows keeps track of different files and components are accessed. The next time the application is accessed, Windows prefetches the necessary items to expedite the application's launch.
The prefetch optimizing code exists both within the XP kernel and the task scheduler service. The kernel keeps track of pages that are referenced by a given process immediately after the process is created. The service transforms the recorded pages into prefetch instructions for that process. The next time the process is created, the kernel executes the prefetch instructions, speeding up the creation of the process.
Disk optimization and application/boot prefetching work in tandem. That is, when XP optimizes file system for faster program access, the data it recorded for the application and bootup prefetch processes is factored in to determine optimal file placement on the disks.