Saturday, June 21, 2008

Speeding up Windows Vista boot and shutdown times

 

One of my friends installed today Vista and complained the boot was taking almost 2 minutes, much longer than in XP. I became curious and I thought I should check on my system what are the boot times...

I have Vista installed fore a year and a half now, and I don't boot my computer very often. It turned out that for my system, the boot time took more than 4 minutes!!! 1 minute until the login screen, 4 minutes until the system was idle - this was on a Intel DualCore 6600 (2.4GHz) with 2 GB RAM, the machine I bought in December 2006.

It turns out Microsoft has released some great tools, XBootMgr and Performance Analyzer, that can help you improving the performance of the boot and shutdown times. They are included in  Windows Performance Tools Kit. For help with running the tool, see the On/Off Transition Performance Analyzer page. I downloaded the kit and installed it in C:\Program Files\Microsoft Windows Performance Toolkit.

You should also download the autologon.exe tool. It allows you specifying a username and password that will be used for automatic logon during the performance measuring process. I downloaded the zip file and extracted the tool. From an elevated command prompt, I run the tool like "autologon /username:Constantin\Alin /set" and typed my password. (To open an elevated command prompt, open StartMenu, write "command" in the search box, right click the "Command Prompt" and select "Run as Administrator")

I did a first run with "xbootmgr.exe -trace boot" (the computer will restart automatically in 5 seconds after running the command). As I told you before, the first boot took more than 4 minutes. After reboot I run  "Performance Analyzer" from the icon installed in StartMenu (or run xperfview), and use the Trace/Open menu item to open the *.etl (event trace log) file saved in the same folder. At a first look it's pretty confusing understanding the log graphs, but the first thing that was clear was that disk accesses were slowing things down. The CPU was used 20% average, but the disk was hit really hard, close to 100% all the time.

Here are some simple things that you can try to reduce the disk access times:

1) Defragment the harddrive. The defragmenter in Vista can be invoked from StartMenu (search for "defrag"). Click the "Defragment Now" button in the dialog and select the drives to defragment. The UI sucks, as there is no progress indicator. You can also invoke the tool from command line ("defrag C: -a -w" if you want to perform a full defragmentation), but again there is no progress indicator. Expect to wait a couple of hours to complete...

2) Eliminate unneeded services and startup programs. Nowadays almost every program you install thinks it's necessary to add either a service or a program to run at computer startup, without you actually needing that functionality, or adding features that can be accessed other ways.

The tools to use for eliminating unneeded services and startup programs are the ServiceManager (accessible from StartMenu, search for "Services"), and either Autoruns, Windows Defender (in Tools/SoftwareExplorer/Startup Programs), or if you're familiar with the registry use directly RegEdit.exe and look under the following keys: HKLM\Software\Microsoft\Windows\CurrentVersion\Run and HKCU\Software\Microsoft\Windows\CurrentVersion\Run.

For services, look at the services that are Started and decide whether you need them. Look especially for 3rd party services. If you're not sure what a service does, search its name or the program name on Google, or on sites like BleepingComputer, and you'll find information describing them. If you don't need these services, set them to Disabled or Manual.

For applications, I prefer leaving the keys in registry in case I need them at a later time, but prefix the application paths with something like "donotrunthisapp" that will cause Windows to skip running the application because it won't find a donotrunthisapp.exe executable.

a) Services used by hardware I don't have. If you don't have on your computer devices using Bluetooth, SmartCard, WiFi, TabletPCPen, there is no reason why you'd keep these services enabled...

b) Helper programs. There are a lot of these, and I haven't found any downsides by stopping them.

c) Update checkers. A lot of applications install either services or startup programs that checks whether they are any updates available for them. I don't understand why these programs needs check for updates on every boot instead of scheduling a task or even better when they are used to run once every week.

d) Speed launchers and cache managers. Yes, they may speed up their application, but when their number is growing, they reduce the overall performance of the system...

Here is a list of what applications I disabled on my machine (I was amazed myself how big the list was):

Services:  PnkBstrA (PunkBuster Service Component installed by BattleField game and not removed when the game was uninstalled), GoogleUpdater (installed by GoogleEarth), NVIDIA Display Driver Service (some helper service), Adobe LM (set to Manual instead of Disabled, this is the license manager for Adobe software and will be started when needed), NMIndexingService (Nero media indexing service), Creative ALchemy AL1 Licensing Service (I set to Manual), Cyberlink RichVideo Service (RichVideo - I don't need enhanced video editing support), Bluetooth Support Service, Tablet PC Input Service, Smart Card, Smart Card Removal Policy, TPM Base Services (I set to AutomaticDelayed), etc.

Startup programs: CTHelper and CTxHlp (Creative help programs and API extensions), NMIndexStoreSvr (more Nero indexing), NBKeyScan (used by NeroBackItUp), Steam (used by HalfLife games), RemoteControl, LanguageShortcut and BDRegion (used by Cyberlink DVD software), Adobe Reader Speed Launcher, ehTray (used by MediaCenter tray application), other update software like QuickTime Task, SunJavaUpdateSched, TkBellExe (for RealPlayer),  NvCplDaemon (not needed, I don't overclock the graphic card), NvMediaCenter (not needed to run in tray, display settings can be changed in control panel), etc.

This is where the biggest improvement came from. After this step, the boot took only 2:10 minutes (30 seconds till the logon screen, 30 more seconds until the desktop appeared, 2:10 until idle)

3) Finally, run again the performance tool to force existing internal operating system optimization mechanisms to update their state based on the current configuration of the system.

To do this, I run the "xbootmgr.exe -trace boot -prepSystem". For me it rebooted the computer twice. On the first reboot, it decreased the boot time to 1:55 minutes (30 sec until login, 45 until desktop was shown, 1:55 until idle). It then took about 15 minutes to optimize the boot performance, and rebooted again. This time, the whole boot process took 1:08 !!! (26 seconds till login, 1:08 until idle).

In the end, don't forget to disable the automatic logon. From an elevated command prompt, run the tool like "autologon /delete"

 

In conclusion, out of 21 applications I was running on startup, I kept only 6 of them I needed; I also removed 10 unneeded services; defragmented the harddrive and optimized the booting time. With all these changes, I was able to reduce the Vista boot time on my computer from more than 4 minutes to only 1 minute and 10 seconds (with the desktop usable in less than 45 seconds)!

7 comments:

Anonymous said...

Thanks for the great and detailed post. Your recommendation to stop Bluetooth services alone saved me one minute of boot time (and at least three hours of scouring the internet for other ideas). You'd be surprised at how many times the answer to a post about slow boot times is "deal with it."

Unknown said...

install windows performance analyser kit itsaid that moi processor didnt supported this

Raj said...

ranjithgp4u said...

thats cuz you download the wrong architecture!!

Anonymous said...

It was rather interesting for me to read this post. Thank author for it. I like such themes and everything that is connected to this matter. I would like to read a bit more soon.

Anonymous said...

It is rather interesting for me to read the article. Thanx for it. I like such topics and everything connected to them. I would like to read more soon.

Sunny said...

Do you find your windows system become more and more slowly after used it a few month, the reason is your windows registry stored much rubbish and it becomes bloated. To solve this problem, you can use windows registry cleaners software.

Alin Constantin said...

@Sunny: I've been running registry cleaners since Win'95, they don't help much, and sometimes they even mess up the system more (by deleting keys they think are unused, but that actually are in use).
Sure, deleting unused registry keys (and if you can find them, unused files in Windows directory) that are left around by stupid uninstaller programs might help. But that's not the end of the story.
System slowdowns is more than often due to programs that are still installed. As I've described in the article, by disabling things that were still installed but had no reason to run at startup I got ~3 minutes less in the system startup time... A registry or file cleaner will not help you there much.