Fine-Tuning Performance


Now that you know how to monitor performance, it’s time to get practical with a few specific optimizations. The rest of this chapter shows you how to optimize items such as the Windows XP startup, applications, the hard disk, virtual memory, and more.

Optimizing Startup

One of the longest-running debates in computer circles involves the question of whether or not to turn off the computer when you’re not using it. The “off” camp believes that shutting down the computer reduces hard disk wear-and-tear (because the disk’s platters spin full-time, even when the computer is idle), prevents damage from power surges or power failures that occur while the machine is off, and saves energy. The “on” camp believes that cold starts are hard on many computer components, that energy can be saved by taking advantage of power-saving features, and that leaving the computer running is more productive because it avoids the lengthy startup process.

In the end, I believe it’s the overall boot time that usually determines which of these camps one belongs to. If the startup time is just unbearably long, you’ll certainly be more inclined to leave your computer running all the time. Fortunately, Windows XP has made great strides in improving startup times, which are now routinely measured in seconds instead of minutes. However, if you’re convinced that turning off the computer is a sensible move, but you hate waiting even for Windows XP’s faster startup process, here are a few tips for improving startup performance even more:

  • Reduce or eliminate BIOS checks. Many computers run through one or more diagnostic checks at system startup. For example, it’s common for machines to check the integrity of the system memory chips. That seems like a good idea, but it can take an interminable amount of time to complete on a system with a great deal of memory. Access your system’s BIOS settings and turn off these checks to reduce the overall time of the computer’s Power-On Self Test.

  • Reduce OS Choices menu timeout. If you have two or more operating systems on your computer, you see Windows XP’s OS Choices menu at startup. If you’re paying attention to the startup, you can press Enter as soon as this menu appears, and your system will boot the default operating system. If your mind is focused elsewhere, however, the startup will be delayed 30 seconds until the default choice is selected automatically. If this happens to you frequently, you can reduce that 30-second timeout to speed up the startup. There are four ways to do this:

    • Edit the Boot.ini file. In the [boot loader] section, change the timeout value.

    • Select Start, Run, enter msconfig -4, and click OK. On the System Configuration Utility’s BOOT.INI tab, modify the value in the Timeout text box.

    • Launch Control Panel’s System icon to get to the System Properties dialog box. Select the Advanced tab, click Settings in the Startup And Recovery section of the dialog box, and then adjust the value of the Time To Display List Of Operating Systems spin box.

    • At the command prompt, enter the following command (replace ss with the number of seconds you want to use for the timeout):

      BOOTCFG /Timeout ss 
      Tip

      If your system has multiple hardware profiles, the Hardware Profile menu also appears for 30 seconds before choosing the default profile. You can reduce this timeout by launching Control Panel’s System icon, selecting the Hardware tab, and then clicking Hardware Profiles. In the Hardware Profiles dialog box, choose the Select The First Profile Listed If I Don’t Select A Profile In option and use the spin box below it to set the reduced timeout.

  • In BOOT.INI, use the /NOGUIBOOT switch. This prevents the Windows XP splash screen from appearing, which will shave a small amount of time off the startup.

    Caution

    Using /NOGUIBOOT also means that you won’t see any startup blue-screen errors. In other words, if a problem occurs, all you’ll know for sure is that your system has hung, but you won’t know why. For this reason, the small performance improvement you’ll experience by using /NOGUIBOOT is likely not enough to offset the lack of startup error messages.

  • Upgrade to Windows XP device drivers. Device drivers designed to work with Windows XP generally will load faster than older drivers.

  • Use an automatic logon. One of the best ways to reduce startup time frustration is to ignore the startup altogether by doing something else (such as getting a cup of coffee) while the boot chores occur. This strategy is foiled if the startup is interrupted by the logon process. If you’re the only person who uses your computer, you can overcome this problem by setting up Windows XP to log you on automatically. We discussed this in Chapter 5, “Managing Logons and Users.”

  • Don’t require Ctrl+Alt+Delete. If you must log on, and if you’re using the Classic logon method (that is, you’re not using the new Welcome screen), Windows XP usually asks you to press Ctrl+Alt+Delete before it displays the Log On To Windows dialog box. You can save a startup step by eliminating this usually unnecessary procedure. We show you how to do this in Chapter 5.

  • Reduce or eliminate startup programs. By far the biggest startup bottleneck is the array of programs scheduled to launch automatically when Windows XP loads. Loading many small programs or just a couple of large programs can slow the startup to an excruciating crawl. Use the techniques we discussed in Chapter 4 to reduce the number of startup programs to only those you absolutely need to get going first thing.

  • Use hibernation mode. Hibernation mode, which is supported by most new PCs, saves the current contents of memory (running programs, open documents, and so on) to a file on your hard disk and then shuts down the computer. When you turn the machine back on, Windows XP bypasses the usual startup routines and just restores the memory contents from the hibernation file. The result is that your system is back on its feet in just a few seconds. Before you can use hibernation, you need to make sure it’s enabled on your system by first launching Control Panel’s Power Options icon. In the Power Options Properties dialog box, display the Hibernate tab and select the Enable Hibernation check box. For users of the Welcome logon screen to put the computer into hibernation, select Start, Turn Off Computer, hold down the Shift key, and then select Hibernate. Similarly, for users of the Classic logon screen, select Start, Shut Down and then select Hibernate from the list.

    Caution

    The contents of your system’s memory are stored in a file called Hiberfil.sys in the root folder of whatever drive Windows XP is installed on. This is hardwired into the system and can’t be changed. Therefore, before enabling hibernation, make sure you have plenty of free space on the Windows XP drive. Note that Hiberfil.sys will be as large as the amount of RAM on your system. If you have 256 MB of RAM, the hibernation file will also be approximately 256 MB.

  • Configure the prefetcher. Prefetching is a new Windows XP performance feature that analyzes disk usage and then reads into memory the data that you or your system accesses most frequently. The prefetcher can be used to speed up booting, application launching, or both. You configure the prefetcher using the following registry setting:

    HKLM\SYSTEM\CurrentControlSet\Control\SessionManager  \Memory Management\PrefetchParameters\EnablePrefetcher

    Set this value to 1 for application-only prefetching; 2 for boot-only prefetching; or 3 for both application and boot prefetching. We recommend setting this value to 2 for boot-only prefetching. This will improve boot performance and, on most systems, will have little or no effect on application performance (because the files commonly used to launch application files are probably in the RAM cache anyway).

As a final startup tweak, we also recommend downloading and running Microsoft’s Bootvis tool. Bootvis is a handy tool that not only helps you visualize the startup, but can also help optimize your startup based on traces that it makes of your system’s boot sequence. You can get this tool here:

http://www.microsoft.com/hwdev/platform/performance/fastboot/BootVis.asp

When you launch the downloaded file, be sure to unpack it either in the default Temp folder or in your Desktop folder. Then double-click the Bootvis.exe file to launch Bootvis. The Bootvis window offers several check boxes for items such as CPU Usage and Disk I/O that Bootvis will trace during startup. In most cases, you’ll want to select all the check boxes. For a boot visualization, follow these steps:

  1. Select Trace, Next Boot. The Trace Repetitions dialog box appears, as shown in Figure 11-4.


    Figure 11-4: You see this dialog box when you select the Trace, Next Boot command.

  2. Click OK. Bootvis displays a countdown.

  3. Wait for the countdown to finish or click Reboot Now. Bootvis reboots the system.

When the system reboots, Bootvis launches again automatically. The program displays various charts that document the boot process, as shown in Figure 11-5.

click to expand
Figure 11-5: The charts give you a visual display of the resources used during the boot process.

To optimize your system’s boot process, follow these steps:

  1. Select Trace, Optimize System. Bootvis displays a countdown.

  2. Wait for the countdown to finish or click Reboot Now. Bootvis reboots the system.

When the system reboots, Bootvis rearranges various startup files on disk so that they can be accessed optimally, thus improving boot performance.

Optimizing Applications

Running applications is the reason we use Windows XP, so it’s a rare user who doesn’t want his or her applications to run as fast as possible. Here are some pointers for improving the performance of applications under Windows XP:

  • Add more memory. All applications run in RAM, of course, so the more RAM you have, the less likely it is that Windows XP will have to store excess program or document data in the page file on the hard disk, which is a real performance killer. In Task Manager or System Monitor, watch the Available Memory value. If this starts to get too low, you should consider adding RAM to your system.

  • Install to the fastest hard drive. If your system has multiple hard drives, install your applications on the fastest drive. This will enable Windows XP to access the application’s data and documents faster.

  • Set the prefetcher to optimize application launching. As discussed in the previous section, Windows XP’s new prefetcher component can optimize disk files for booting, application launching, or both. It probably won’t make much difference, but experiment with setting the registry’s EnablePrefetcher value to 1 or 3 to optimize application launching.

  • Get the latest device drivers. If your application works with a device, check with the manufacturer or Windows Update to see if a newer version of the device driver is available. In general, the newer the driver, the faster its performance. We show you how to update device drivers in Chapter 9, “Installing and Troubleshooting Devices.”

  • Make sure Windows XP is optimized for programs. Launch Control Panel’s System icon, select the Advanced Tab, and then click Settings in the Performance section of the dialog box. In the Performance Options dialog box, select the Advanced tab, shown in Figure 11-6. In both the Process Scheduling and the Memory Usage sections of the dialog box, select the Programs option.

click to expand
Figure 11-6: Figure Use the Advanced tab to optimize Windows XP for programs.

  • Set the program priority in Task Manager. To maximize a program’s performance under Windows XP, tell the system to give the program a higher priority than other applications. To do this, first make sure your program is running. Then run Task Manager and select the Processes tab. Right-click your application’s process, select Set Priority, and then select (from highest priority to lowest) Realtime, High, or AboveNormal.

    Insider Secret

    If you’re not sure which process belongs to your program, select the Task Manager’s Applications tab, right-click the program’s name, and then select Go To Process.

Optimizing the Hard Disk

Windows XP accesses the hard disk to fetch application code and documents as well as to store data temporarily in the page file. Therefore, optimizing your hard disk can greatly improve Windows XP’s overall performance.

If you’re looking to add another drive to your system, your starting point should be the drive itself, specifically its theoretical performance specifications. Compare the drive’s average seek time with other drives of the same capacity (the lower the value the better). Also, pay attention to the rate at which the drive spins the disk’s platters. A 7200-RPM (or higher) drive will have noticeably faster performance than, say, a 5400-RPM drive.

For an existing drive, optimization is the same as maintenance, so you should implement the maintenance plan we discuss in Chapter 12, “Maintaining Your System in 10 Easy Steps.” For a hard disk, this means you should attend to the following:

  • Keep an eye on the disk’s free space to make sure it doesn’t get too low.

  • Periodically clean out any unnecessary files on the disk.

  • Uninstall any programs or devices you no longer use.

  • Check all partitions frequently for errors.

  • Defragment partitions on a regular schedule.

Also, don’t use compression or encryption on a partition if you don’t have to. Both technologies slow down disk accesses because of the overhead involved in both the compression/decompression and the encryption/decryption processes. Finally, consider turning off the Indexing Service for a drive if you don’t do much file searching. To do this, right-click the drive in Windows Explorer and then select Properties. On the General tab, clear the Allow Indexing Service To Index This Disk For Fast File Searching check box.

Insider Secret

tYou should also make sure your hard disk has write caching enabled. Write caching means that Windows XP doesn’t flush changed data to the disk until the system is idle, which improves performance. The downside is that a power outage or system crash means the data never gets written, so the changes are lost. The chances of this happening are minimal; we recommend leaving write caching enabled, which is the Windows XP default. To make sure, click Start, Control Panel, double-click System, click Hardware, Device Manager, open the Disk Drives branch, and double-click your hard disk. On the Policies tab, make sure the Enable Write Caching On The Disk check box is selected.

Converting FAT16 and FAT32 Partitions to NTFS

The Windows NT file system (NTFS) is your best choice if you want optimal hard disk performance since, in most cases, NTFS outperforms both FAT16 and FAT32. (This is particularly true with large partitions and with partitions that have numerous files.) Note, however, that for best NTFS performance, you should format a partition as NTFS and then add files to it. If this isn’t possible, Windows XP offers the CONVERT utility for converting a FAT 16 or FAT32 drive to NTFS:

CONVERT volume /FS:NTFS [/V] [/CvtArea:filename] [/NoSecurity] [/X]

 volume 

Specifies the drive letter (followed by a colon) or volume name you want to convert.

/FS:NTFS

Specifies that the volume is to be converted to NTFS.

/V

Uses verbose mode, which gives detailed information during the conversion.

/CvtArea:filename 

Specifies a contiguous placeholder file in the root directory that will be used to store the NTFS system files.

/NoSecurity

Specifies that the default NTFS permissions are not to be applied to this volume. All the converted files and folders will be accessible by all users.

/X

Forces the volume to dismount first if it currently has open files.

For example, running the following command at the command prompt converts drive C to NTFS:

convert c: /FS:NTFS

Note, however, that if Windows XP is installed on the partition you’re trying to convert, you’ll see the following message:

Convert cannot gain exclusive access to the C: drive, so it cannot   convert it now. Would you like to schedule it to be converted the   next time the system restarts? <Y/N>

In this case, press Y to schedule the conversion.

Optimizing NTFS

If you make the move to NTFS, either via formatting a partition during Setup or by using the CONVERT utility, you can implement a couple of other tweaks to maximize NTFS performance:

  • Turn off 8.3 file name creation. To support legacy applications that don’t understand long file names, NTFS keeps track of both the long name for each file as well as a shorter name that conforms to the old 8.3 standard used by the original DOS file systems. The overhead involved in tracking two names for one file isn’t much for a small number of files, but it can become onerous if a folder has a huge number of files (300,000 or more). To disable the tracking of an 8.3 name for each file, enter the following statement at the command prompt:

    FSUTIL BEHAVIOR SET DISABLE8DOT3 1

    Note, too, that you can do the same thing by changing the value of the following registry setting to 1 (note that the default value is 0):

    HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation

  • Disable Last Access timestamp. For each folder and file, NTFS stores an attribute called Last Access Time that tells you when the folder or file was last accessed by the user. If you have folders that have a large number of files and if you use programs that access the files frequently, writing the Last Access Time data can slow down NTFS. To disable writing of the Last Access Time attribute, enter the following statement at the command prompt:

    FSUTIL BEHAVIOR SET DISABLELASTACCESS 1

    You can achieve the same effect by creating the following DWORD setting and changing its value to 1 (note that the default value is 0):

    HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisableLastAccessUpdate

Optimizing Virtual Memory

No matter how much main memory your system boasts, Windows XP still creates and uses a page file for virtual memory. To maximize page file performance, you should make sure that Windows XP is working with the page file optimally. Here are some techniques that help you do just that:

  • Store the page file on the hard disk that has the fastest access time. You’ll see later in this section that you can indicate which hard disk to use for the page file. If you have multiple hard disks (not just multiple partitions of a single disk), you should store the page file on the disk that has the fastest access time.

  • Store the page file on an uncompressed hard disk. Windows XP is happy to store the page file on a compressed hard disk. However, as with all file operations on a compressed disk, the performance of page file operations suffers thanks to the compression and decompression required. Therefore, you should store the page file on an uncompressed disk.

  • Store the page file on the hard disk that has the most free space. Windows XP expands and contracts the page file dynamically depending on the system’s needs. To give Windows XP the most flexibility, make sure the page file resides on a hard disk that has a lot of free space.

  • Split the page file over two or more physical drives. If you have two or more physical drives (not just two or more partitions on a single physical drive), splitting the page file over each drive can improve performance because it means Windows XP can extract data from each drive’s page file simultaneously. For example, if your current initial page file size is 384 MB, then on one drive you’d set up a page file with a 192-MB initial size, and on a second drive you’d set up another page file with a 192-MB initial size.

  • Customize the page file size. By default, Windows XP sets the initial size of the page file to 1.5 times the amount of RAM in your system, and it sets the maximum size of the page file to three times the amount of RAM. For example, on a system with 256 MB of RAM, the page file’s initial size will be 384 MB and its maximum size will be 768 MB. The default values work well on most systems, but you may want to customize these sizes to suit your own configuration. Here are some notes about custom page file sizes:

    • The less RAM you have, the more likely it is that Windows XP will use the page file, so the Windows XP default page file sizes make sense. If your computer has less than 512 MB of RAM, you should leave the page file sizes as is.

    • The more RAM you have, the less likely it is that Windows XP will use the page file. Therefore, the default initial page file size is too large and the disk space reserved by Windows XP is wasted. On systems with 512 MB of RAM or more, you should set the initial page file size to half the RAM size, while leaving the maximum size at three times RAM, just in case.

    • If disk space is at a premium and you can’t move the page file to a drive with more free space, set the initial page file size to 2 MB (the minimum size supported by Windows XP). This should eventually result in the smallest possible page file, but you’ll see a bit of a performance drop because Windows XP will often have to dynamically increase the size the page file as you work with your programs.

    • You might think that setting the initial size and the maximum size to the same (relatively large—say, two or three times RAM) value would improve performance since it would mean that Windows XP would never resize the page file. In practice, however, it has been shown that this trick does not improve performance, and in some cases can actually decrease performance.

    • If you have a large amount of RAM (at least 1 GB), you might think that Windows XP would never need virtual memory, so that it would be okay to turn off the page file. This won’t work, however, because Windows XP needs the page file anyway, and some programs may crash if no virtual memory is present.

  • Watch the page file size. Start up all the programs you normally use (and perhaps a few extra, for good measure) and then watch System Monitor’s Process\Page File Bytes and Process\Page File Bytes Peak counters.

Changing the Paging File’s Location and Size

The page file is named Pagefile.sys, and it’s stored in the root folder of the drive on which Windows XP is installed. Here’s how to change the hard disk that Windows XP uses to store the page file as well as the page file sizes:

  1. If necessary, defragment the hard disk that you’ll be using for the page file. See Chapter 12, “Maintaining Your System in 10 Easy Steps.”

  2. Launch Control Panel’s System icon to display the System Properties dialog box.

  3. In the Advanced tab’s Performance section of the dialog box, click Settings to display the Performance Options dialog box.

  4. In the Performance Options dialog box, within the Advanced tab’s Virtual Memory section of the dialog box, click Change. Windows XP displays the Virtual Memory dialog box, shown in Figure 11-7.


    Figure 11-7: : Use the Virtual Memory dialog box to select a different hard disk to store the page file.

  5. Use the Drive list to select the hard drive you want to use.

  6. Select a page file size option:

    • Custom Size Choose this option to set your own page file sizes using the Initial Size (MB) and Maximum Size (MB) text boxes. Ensure that Windows XP is able to dynamically resize the page file as needed by entering a maximum size that’s larger than the initial size.

    • System Managed Size Choose this option to let Windows XP manage the page file sizes for you.

    • No Paging File Choose this option to disable the page file on the selected drive.

  7. Click Set.

Close all the dialog boxes. If you changed the drive, or if you decreased either the initial size or the maximum size, you need to restart your computer to put the changes into effect.

Insider Secret

If you want to move the page file to another drive, first select the original drive and then choose the No Paging File option to remove the page file from that drive. Then select the other drive and choose either Custom Size or System Managed Size to add a new page file to that drive.

If you want to split the page file over a second drive, leave the original drive as is, select the second drive, and choose either Custom Size or System Managed Size to create a second page file on that drive. If Custom Size is specified for either or both drives, set the new values now.

Defragmenting the Paging File

As Windows XP dynamically sizes the page file, it’s possible that it can become fragmented, resulting in a small performance hit. Windows XP manipulates the page file in relatively large blocks, so the fragmentation rarely occurs. However, if you’re looking to eke out every last drop of performance on your machine, you should probably ensure that the page file is defragmented.

Unfortunately, Windows XP Disk Defragmenter tool does not defragment the page file. To accomplish this, you have to temporarily move or disable the page file. Here are the steps to follow:

  1. Display the Virtual Memory dialog box as described in the previous section.

  2. You have two ways to proceed:

    • If you have a second hard drive on your system, first set up a page file on the other hard drive using the same initial and maximum values of the original page file. Then select the original drive, select Custom Size, and reduce the initial and maximum sizes to 0 for the page file.

    • If you have only one hard drive, note the current values, and then select No Paging File to disable the page file.

  3. Restart your computer.

    Insider Secret

    To determine whether the page file is defragmented, run Disk Defragmenter and analyze the partition that contains the page file. View the analysis report and, in the Volume Information list, find the Pagefile Fragmentation item. The Total Fragments value tells you the number of fragments used by the page file.

  4. Defragment the hard drive that contained the original page file.

  5. Display the Virtual Memory dialog box and restore the original page file settings.

  6. Restart your computer.

Adjusting Power Options

Windows XP’s power management options can shut down your system’s monitor or hard disk to save energy. Unfortunately, it takes a few seconds for the system to power up these devices again, which can be frustrating when you want to get back to work. You can do two things to eliminate or reduce this frustration:

  • Don’t let Windows XP turn off the monitor and hard disk. Launch Control Panel’s Power Options icon to display the Power Options Properties dialog box. On the Power Schemes tab, use the Power Schemes list to select the Always On item (this is optional) and select Never in the Turn Off Monitor and Turn Off Hard Disks lists. For good measure, you should also make sure Never is selected in the System Standby and System Hibernates lists.

  • Don’t use a screen saver. Again, it can take a few seconds for Windows XP to recover from a screen saver. To ensure you’re not using one, launch Control Panel’s Display icon, display the Screen Saver tab, and choose (None) in the Screen Saver list. (If you’re worried about monitor wear-and-tear, use the Blank or Windows XP screen savers, which are relatively lightweight and can be exited quickly.)

Turning Off Fast User Switching

Windows XP’s Fast User Switching feature enables multiple users to keep programs and documents running concurrently, which makes it easy to quickly switch from one user to another. Of course, having multiple sets of running programs and open documents adds to the memory and resource requirements of your system, which slows down performance for all users. In other words, the time saved by switching users quickly is most likely lost several times over by overall slower performance.

Therefore, you should disable Fast User Switching by following these steps:

  1. Launch Control Panel’s User Accounts icon.

  2. Click the Change The Way Users Log On Or Off link.

  3. Clear the Use Fast User Switching check box.

  4. Click Apply Options.

Reducing the Use of Visual Effects

Windows XP uses a large number of visual effects to enhance the user’s overall Windows experience. For example, Windows XP animates the movement of windows when you minimize or maximize them; it fades or scrolls in menus and tooltips; and it adds small visual touches such as shadows under menus and the mouse pointer. Most of these effects serve merely cosmetic purposes and are drains (albeit small ones) on system performance. If you don’t need some or all of these effects, you can choose to turn them off:

  • Launch Control Panel’s Display icon, display the Appearance tab, and click Effects. In the Effects dialog box (see Figure 11-8), clear the following check boxes:

    click to expand
    Figure 11-8: Clear most of the check boxes in the Effects dialog box to improve performance.

    • Use The Following Transition Effect For Menus And Tooltips

    • Use The Following Method To Smooth Edges Of Screen Fonts

    • Show Shadows Under Menus

    • Show Window Contents While Dragging

  • While you have the Display Properties dialog box open, display the Settings tab and choose Medium (16 bit) in the Color Quality list. Using fewer colors gives your graphics card less to do, which should speed up video performance. Also, click Advanced, display the Troubleshooting tab, and make sure the Hardware Acceleration slider is set to Full.

  • Launch Control Panel’s System icon, display the Advanced tab, and click Settings in the Performance section of the dialog box. On the Visual Effects tab of the Performance Options dialog box (see Figure 11-9), either select the Adjust For Best Performance option (which clears all the check boxes) or choose Custom and then clear the check boxes for the effects you want to disable.

    click to expand
    Figure 11-9: Clear the check boxes on the Visual Effects tab to improve performance.

  • Launch Tweak UI and select the Mouse branch. Move the Menu Speed slider all the way to the left (Fast). This eliminates the delay when you hover the mouse over a menu item that displays a submenu. This is equivalent to setting the following registry value to 0:

    HKCU\Control Panel\Desktop\MenuShowDelay




Insider Power Techniques for Microsoft Windows XP
Insider Power Techniques for Microsoft Windows XP (Bpg-Other)
ISBN: 0735618968
EAN: 2147483647
Year: 2005
Pages: 126

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net