Windows XP: Accelerating Windows XP Startup

Before the appearance of the "Start" button or three minutes: the soldier is sleeping, the service is on.

Moreover, it takes only once or twice a day to load these few minutes to boot the system. But at home, when an impatient teenager wants after school to quickly get on the Internet, until the parents came and saw what he was looking out for - every second now counts.

And not to frighten ordinary users with long tedious downloads, the creators of Windows XP tried to glory - for the first time one of the priorities in creating the OS was precisely the time it takes to start the system, as well as to output it from the StandBy and Hybernate modes.

Theory

When creating Windows XP was tasked to achieve on a typical home desktop such indicators:

- exit from Standby mode (S3) - no more than 5 seconds;
- exit from the Hibernate mode (S4) - no more than 20 seconds;
- Normal loading up to the operating state - no more than 30 seconds.

Of course, without some exceptions, it's impossible to do, they recognized the developers immediately. For example, PCs with ultra-high capacity disks, with some SCSI adapters, with RD-Ram, ECC memory or with localized kanji, should be loaded slightly slower, but the average PC with Windows XP should not lose 9x systems in this respect. Strictly speaking, all this turned out to be feasible today on more or less modern computers - thanks to the implementation of OnNow technology requirements (www.microsoft.com/hwdev/onnow) and ACPI (www.teleport.com/~acpi). But what exactly was done and whether Microsoft conceived or not, we will try to figure it out.

The progress of the full Windows XP boot can be divided into four stages:

- loading the main OS files into memory;
- device initialization;
- user registration (Winlogon), start of system services and shell Explorer;
- download additional software.

Since the set of programs that are automatically downloaded at the start of the system on each PC is different, the end of the boot of the operating system itself is logical to consider the end of the loading of its shell - Explorer when the Desktop appears on the screen. Therefore, for the extreme points of reference when measuring time, the moment was taken to press the Power button and the moment the shortcuts appeared on the Desktop.

If you look more closely at the resultant major improvements in the progress of Windows XP boot, then for a conditional average PC it consists of the following processes, some of which run in parallel:

- initial initialization (in particular - disks) - in Windows XP is about 2 seconds against 8 in Windows 2000;
- initialization of device drivers - depends on the specific system, about 4 seconds;
- A novelty of Windows XP - prefetch reading "Prefetching", in which from the disk beforehand the data not yet requested is read out; Is performed in parallel with the initialization of the devices - about 6 seconds;
- Initialization of the registry and paging file - a couple of seconds;
- initialization of the video subsystem and setting the desired screen resolution - also on the order of a couple of seconds;
- user registration and services start - about 8 seconds;
- Start Explorer shell - 2 seconds.

As you can see, ideally should not be more than 20-30 seconds, which is quite comparable with the load time of much simpler Windows 9x systems. And all due to the fact that in Windows XP, acceleration occurs literally at all stages of the boot due to such techniques as read-ahead data reading, parallel device initialization, parallel execution of various stages of loading, deferred launch of a number of services, exclusion of a number of components from the boot process, Services into one common process, and when the user is registered, the network initialization is no longer required, and access to network resources at boot time is minimized.

In addition, Windows XP supports the Simple Boot Flag specification (www.microsoft.com/hwdev/desinit/simp_bios.htm), which automatically reduces the time required by the BIOS to perform a POST self-test if the previous OS boot was successful. The ntldr system loader has been improved, which now manages to cache data about files and directories in order to reduce disk access during boot.

This results in a fourfold acceleration of its operation compared to Windows 2000. And if there are two operating systems on the PC - Windows 2000 and Windows XP, this effect (but only this one - connected with the improvement of ntldr) will affect the "screw", as its bootloader Will be rewritten more advanced. By the way, thanks to the new features of ntldr, the system's output from sleep mode also accelerated. Well, in addition, there are a number of minor improvements: for example, the initialization of the registry has been speeded up, the time for searching for PS / 2 keypads has been reduced, and if you have a network card that is not connected to the network, this circumstance will no longer cause delay in downloading.

Optimized power management in many aspects, in particular, the work of Hibernation hibernation mode has been improved - now blank file pages are not reset to the RAM image file, the compression algorithm is improved, when writing to the disk of the hyberfil.sys file, DMA mode is used, and writing to disk and Compression are parallel processes. Updated the algorithm for alerting devices and applications about changing the power mode. As a result, not only the usual boot is accelerated, but also the awakening of the PC from the sleeping and waiting modes.

But special attention deserves the key mode of pre-emptive reading - Prefetching. In previous systems, during boot-up, when initializing the drivers, loading services and the shell, the data from the disk to the memory was loaded sequentially, as requests for them were received.

Now Windows XP, in parallel with the execution of other operations, reads this data in advance, without waiting for the request, which leads to the most significant effect. This intelligent predictive reading algorithm is also applied to the launch of programs - after the first start of each program, special download scripts are created (they are stored in the \ Winnt \ Prefetch folder), which describe which files need to be stored in advance.

The same files, or rather their common denominator - the file \ Winnt \ Prefetch \ layout.ini - is then used by the defragmenter to optimize the location of the files on the disk, which further reduces the download time.

By the way, you can check for yourself how effective this mechanism is with respect to the OS download - you can disable Prefetching by setting the registry key
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Session Manager \ Memory Management \ PrefetchParameters parameter "EnablePrefetcher" to "0".

The OS boot record itself is fixed in the file% WinDir% \ Prefetch \ notosboot-B00DFAAD.pf, which for more objectivity contains information about the last 8 starts of the OS and is updated every 1 minute after the system boots (monitoring is completed 10 seconds after the start Loading Explorer shell, so that some autoloading programs fall under it). If you delete it, the next download will not use pre-read and you will most likely find that the system is loaded almost twice as slow.

But that's not all. In Windows XP there is a new function BootDefrag (or BootOptimize), the essence of which is as follows. Because the defragmentation and optimization of the location on the disk of the files needed by the system at boot time, decisively affects the entire process of loading the OS, and the user often lazily starts the defragmenter himself (not that often, but almost always), the system now knows how - so Say, without operator participation - to optimize these files, and not as she pleases, but based on the data of all the same files notosboot-B00DFAAD.pf and layout.ini.

True, automatic defragmentation occurs when the system is idle - if the user did not perform any operations 10-30 minutes after the OS boot. That is why it can happen that on your intensively used system the files will not be optimized.

To check, whether there was an optimization, it is possible, having glanced in the register - if in section
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Dfrg \ BootOptimizeFunction is set to "OptimizeComplete" = "Yes",
Then the defragmentation was performed. If this has not happened yet, then just reboot the PC and leave it for thirty minutes alone - Windows will do everything itself, and the acceleration of the next boot will be noticeable even by eye.

Just remember that before optimizing a PC with a freshly installed OS, you must have at least three reboots in your luggage to accumulate the necessary data. The native defragmenter of Windows XP does not cancel this optimization, so you can use it safely.

If you are not sure whether this function works at all or want to disable it, check the registry for the presence of a parameter that includes BootDefrag:
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Dfrg \ BootOptimizeFunction - the parameter "Enable" = "Y".

In principle, if the system is already optimized once and the files on the disk are properly located, then it hardly makes sense to leave this function on and on - its disconnection can speed up the download a little more.

Practice

But, unfortunately, the desired does not always correspond to the real. In order to find out how things are in reality, on quite specific computers, rather than on abstract systems from testing laboratories in Redmond, you will have to arm yourself with a stopwatch and a small utilities that allow you to measure objectively the load time of the system as objectively as possible and to forcefully monitor Optimizing boot files.

It's called BootVis, and you can download it from here -
Www.microsoft.com/hwdev/fastboot/download/ BootVis_File.exe.
This utility is remarkable in all respects and caused its recent appearance a real furor in some network conferences. In all the news it was claimed that after using it the system starts to be loaded by 30%, or even 50% faster. About how fair this is, we'll talk more, but for now, we are interested in her work in monitoring OS downloads.

In addition to the fact that BootVis graphically shows how much and at what stage of system loading it takes time (for example, parallel execution of these stages on its graphs is observed more than clearly), it can display the CPU load graph at system start, the graph of disk input operations Output, a schedule of delays when loading drivers, and a number of data useful not only for satisfying one's own curiosity, but also for finding out the reasons for the congestion of the system during its download.

Similar information is displayed for both StandBy and Hibernate modes - the whole process of falling asleep and waking up the computer is perfectly visible on the timeline. By the way, the information displayed by the program is not limited to graphs - even more detailed information on each stage of OS download can be obtained if you use the context menu that appears when you right-click on a section of the graph.

It is very easy to use the program, and it does not require installation - just unpack the downloaded archive into any convenient folder or directly to the Desktop. After launching it in the "Trace" menu, you will see four commands: Next Boot, Next Boot with Driver Delays, Next Standby / Resume, Next Hibernate / Resume.

These are the test modes that BootVis offers. Note only that when testing the time to go into sleep mode and return from it beyond BootVis control, the hyberfil.sys file remains, in which the contents of the RAM are stored, so you can not do without a stopwatch. For our own case of determining the boot time of Windows, we need to select the "Next Boot" mode, after which the program will overload the system and immediately after starting the PC will start monitoring the process of launching the OS.

As soon as Windows is fully booted, the BootVis window will automatically appear on the display with all the information it has collected. The only condition for its successful operation is that you can not turn off the Task Scheduler, otherwise the program will not be able to start itself.

So, on a test laptop Sony VAIO FX101 (Celeron 600, 128MB, 10GB UDMA / 66), on which the "Millennium" loads in seconds for 20, the second system was installed - Windows XP (partition FAT32). To begin with, we put BootVis aside and measure it with a stopwatch only, so that there is no risk of distorting them with some kind of BootVis influence. The very first boot of Windows XP was the longest - in addition to the fact that the system was not optimized in any way, during the first launch it was also a lot of nonsense such as the promotional tour of Windows XP.

It took almost a minute, which immediately reminded the sleepy Windows 2000. By the way, the very first boot is not monitored by the OS and is not taken into account in the subsequent optimization, because because of its features is not typical. Next, we perform several reboots of the OS in a row and get a good repetition, which means that an objective result - about 40 seconds - is needed to run a non-optimized Windows XP on a real and not very lagging PC. This, of course, is two times worse than Windows Me, but improvements in relation to Windows 2000 are already noticeable (although the new system has not yet reached the declared 30 seconds by Microsoft).

In order for the BootDefrag function to work, we will try to leave the system idle for 30 minutes immediately after loading. (This is exactly what many users who are not familiar with the features of Windows XP are doing, because of which their system for a long time does not show all its capabilities. ) And really - after 20 minutes of idle time itself there is some disk activity, very similar to the defragmentation process, it lasts all minutes 5.

Let's see what happened. Overload the PC - and it turns out that the Desktop appears on the screen after 27-28 seconds! Here they are, new technologies in action! I do not exclude that due to them on some PC Windows XP will be loaded even faster than Windows Me. So we can definitely say that Microsoft this time fulfilled its promises - the system is loaded very quickly.

Let's see what effect the application of BootVis so joyously received by the general public will have. First we will conduct a normal load monitoring to find out how much its data coincides with what our stopwatch shows. After several tests, we get an average OS boot time equal to 25 seconds - this is two seconds less than the results of the manual method, which, in general, is not so critical and can be attributed to the measurement error and a small discrepancy of the reference points.

The main thing is that the result is consistently repeated from download to download, so you can move on to the most interesting experiment: allow BootVis to optimize the system to get the promised 30 percent increase in download speed. Our 25 seconds should after that miraculously turn into 15, which is not just cool, but very cool even for Windows Me! In the Trace menu, select the item "Optimize System" and for several tedious minutes of waiting we observe how after the reboot the program persistently rustles the hard drive, moving files over its tricky algorithms. When the defragmentation process is complete, restart the load time monitoring in BootVis, reboot the PC and see what happens ...

And it turned out the same 25 seconds ... Where is the promised 30 and 50% ?? There is no effect from the program! And the whole point is that our test system has optimized itself once already - the difference between 40 seconds and 27 seconds is exactly the same 30%, and nothing more can be done here. At least, the changes after the BootVis actions are too insignificant to be worthy of mention.

Rumors about the miraculous capabilities of BootVis, apparently, went from those comrades who are so actively using their PC that Windows does not have a minute of free time to conduct defragmentation of the boot files.

So, there are no big hopes for this program - the mechanisms built in Windows XP, and without it, are coping well with the optimization of the boot process, it is necessary only after the next inclusion of the PC to give the system half an hour of rest. BootVis only does all the same, but at the user's request, at a convenient time for it. The main advantage of this program is that after its application it does not get worse, so try it - if there is a desire for the sake of an illusory hope to download 325 kb.

Recommendations

In parallel with the serious improvement of the operating system in terms of power management and downloads, Microsoft gives recommendations and users to take a number of efforts from their side in order to help Windows XP prove itself in all its glory.

However, all this does not mean that recommendations suitable for accelerating the loading of the OS will have the same beneficial effect on the rest of the process of communicating with Windows - for example, NTFS is not always justified on home systems, but using a disk that has only one partition, Extremely inconvenient. You can read the source at www.microsoft.com/hwdev/fastboot, in short the Microsoft recommendations are as follows.

- Use the NTFS file system - unlike FAT32, it does not require putting an entire FAT table into memory at boot, which is noticeable on disks larger than 8 GB.
- Do not use FAT32 conversion to NTFS after OS installation - delete all FAT partitions before OS installation and allow it to create NTFS file system during installation.
- Use only one partition on the disk.
- Install the hard disk as the first boot device.
- Use all CMOS Setup settings, which allow to reduce loading and holding time for POST.
- Disable logos, which are often sewn into the system BIOS and BIOS of the video card.
- Disable in CMOS Setup to search for devices on idle IDE channels.
- Have the latest BIOS version for your motherboard with support for the Simple Boot Flag function and the updated BIOS of the video card.
- A fast drive is desirable - from 7200 rpm, having a large buffer.
- A sufficient amount of RAM is required - from 128 MB.
- A modern processor is needed.
- Make sure that the defragmentation of boot files by the BootDefrag function was done and try using the BootVis utility - it is possible, on your system, it will still achieve deeper optimization.

- Reduce the number of autoloadable programs and system services.
- Do not use the desktop wallpaper and other decorative "gadgets".
But, even taking advantage of these tips, you most likely will not get a big increase in download speed - for example, on my test laptop, disabling a number of unnecessary services and removing absolutely all programs from the startup gave a win of less than a second, which, of course, The general background looks very pale.

In general, as we have seen, progress in the noble family of Windows NT is obvious, it's a pity that the owners of Windows Me, which are more familiar to many, can not use the utility of the same plan as BootVis to optimize their system.

As far as I know, all they can do in seconds is analyzing the OS boot protocol using the Boot Log Analyzer program (www.vision4.dial.pipex.com) and a small utility from the same Microsoft - Devview (www. Microsoft.com/hwdev/NewPC/download/ pnptool.exe), which shows which device and how long it takes to initialize it when the system boots. Personally, after analyzing the data it collected, I disconnected the COM and LPT ports that I did not need on my PC, but the gain from this operation was about a second.

However, not in seconds do we fight? For them!