Search This Blog

Wednesday, August 11, 2010

Improving Windows 7 Startup Times

Intro - Improving Windows 7 Start-Up Time

Whoa ... Windows 7 I hear you say . Well yeah, I admit it, I do use Windows products, despite my admitted love for *nix products and the Ubuntu series of Linux OS's. At work (at the moment) its a case of Windows XP and I have to make do with a Cygwin install as well as putty to various *nix boxes. Anyways, a Windows 7 laptop I'm using after a few months seemed to be slowing down on start-up. I'd installed a few bits and pieces and now it seemed that when I started up there were a million things that would initialize on start-up, popup an icon and then go into the background. this cant be good having this many things starting, especially given that a large amount of them I didn't use. For example, one of the things that would start-up was the HP Dock Adviser, one of a number of Hewlett Packard (HP) tools that had been installed on purchase of the laptop (as it was a HP laptop). This kind of thing really shits me. Yeah its a HP laptop, but give me the option if whether I want your 20 different applications for adjusting things. whats really cruddy is that they adjust things that come with default windows adjustments, like for example the HP Sound tone App, which is just a slightly prettier version of the little windows speaker icon for adjusting volume. Now why the hell would I want to use the HP one when I already have an ample way of adjusting sound with the windows one. To top it off, if I add in speakers and the drivers for them they will probably come with their own volume tool anyways which will be much better and more suitable for the speakers than the HP one so that make shite HP app totally pointless....yet there it is every single start-up time loading and sitting in the background. Now Id taken to killing these off each time they started ... but there had to be a better way. So here is what I found, noted down for the future in case I need to refer to this again.

Steps to Better Performance of Windows 7 Start-Up Times

So what to do? Well, as I see it I need to do the following:
  1. Check the current start-up time duration (total and individual apps, including apps taking excessive times)
  2. See whats currently being started (which apps/services etc)
  3. Identify which applications take too much time or are pointless and remove them. The tools to do this need to be in Windows 7 by default & I don't want to have to download other applications. So what does Windows 7 provide me in this case: Event Viewer - for viewing start-up time logs, msconfig - for configuring start-up apps and services

Event Viewer and Performance Logs

Event Viewer and Performance Logs - Introduction And Log Location

The Event Viewer (which is found under Control Panel\All Control Panel Items\Administrative Tools) provides access to a bewildering number of logs. First off the option to show analytic and debug logs should be switched off as they are mainly for developers and only add further logs to an already large number. Unfortunately there doesn't really seem to be a good set of documentation on all of these many, many logs. After some searching on the web I found that in my case the particular log that I wanted was found under the following location in the Event Viewer log directory setup:

Applications and Services Log-->Microsoft-->Windows-->Diagnostics-->Performance-->Operational

Event Viewer and Performance Logs - Event ID 100 (Start-Up Event/Time)

Now furthermore there are a number of different Event ID logs. The logs 100-199 I think are the main one referring to start-up/boot performance. In particular Event ID 100 is the one that refers to actual start up time.


So to see your last start-up time duration simply click in the Event Viewer on the last log with a Event ID 100. You'll see an event log similar to something like the image above. The highlighted Boot Duration time is the key figure we are interested in as it show time taken for the boot/start-up to occur.  In my case the following times and values (below text) was the actual values I got in the General Details section when I had a look at my last start-up time (and other times where roughly the same...in the same range):

Windows has started up:
     Boot Duration        :    157538ms
     IsDegradation        :    false
     Incident Time (UTC)  :    ?2010?-?08?-?10T00:42:39.749600500Z

This shows that in my case the start-up took 157 seconds. Thats about 2 and a half or more minutes. In my opinion that's fairly slow. However, next I looked back through the log history towards the start of the log (I've only had the laptop for a few months so this wasn't far back). In the beginning I could see start-up times of under a minute. Furthermore, I could see, by looking at the list of installed programs in the Control Panel under 'Programs and Features' (i.e.: Control Panel\All Control Panel Items\Programs and Features) that on the date when a large number of installs where performed all in one day the start-up time visibly reduced from under a minute to over 2 minutes on the one day for all subsequent start-up times.

Event Viewer and Performance Logs - Event ID 100 (Detailed Event Breakdown - Key Times)

Another important feature to have a look at is the Start-Up time breakdown. The start-up time consists of starting a large number of various devices, services, processes, etc. There are ways that I've seen where you can actually generate and view a log file containing a list of and timing details for each one of these services starting up.  The log I saw was comprised of roughly 3/4 of a million objects (i.e. each object being a process, service and in most cases each object referred to the call of a method or the creation of an object in the device drivers that were executed etc. This makes sense as there are obviously not 750,000 services that start but it is possible that this many member variables and objects etc, are initialized by the code running the device drivers etc.).  This detailed logging I may at some point go through in more detail (primarily for my own interest, since the actual info is at too low a level to be of use to anyone but device driver or service implementers/developers etc). If I end up doing this (when the curiosity gets the better of me or if there is enough requests / interest in this) then there'll be a link to the article from HERE.



In the mean-time the only breakdown I intend to look at is a much higher level. By looking at the "details" tab in the Event Viewer Event, which can be seen in the image above you get a choice of either the friendly view or the XML view. Either way there are a number of different bits of information presented. Out of all of these there are 3 key bits of high-level information (well actually 2, because the other 3rd one is simply the total of the 2 added and is the total start-up time that we've already seen/know from the first tab). Anyways, these 2 or 3 high-level pieces of timing info are found under:

Boot Time:       157538
MainPathBootTime: 75397
BootPostBootTime: 82141

These times are a breakdown of the total Boot Time (as can be seen from adding them up to get the total time) and the two parts that the total boot time is divided into are:
  • MainPathBootTime measures the time it takes for the system to load all drivers and services that are critical to user interaction and get to the Windows desktop where the user can begin doing things.
  • BootPostBootTime includes all the other drivers and processes that aren’t critical to user interaction and can be loaded with low-priority I/O that always gives preference to user-initiated actions that execute using Normal I/O priority.

Event Viewer and Performance Logs - Event ID 100 (Detailed Event Breakdown - Other Times)

There are two other times Ill briefly mention here while discussing the Event Breakdown of times. Although not key to performance improvements (they used to be but no longer are valid) they are worth mentioning for that historic reason and they are:

BootDriverInitTime:    3314
... snip ...
BootPrefetchInitTime: 53087

BootDriverInitTime - The first one, 'BootDriverInitTime' will be high if Windows 7 is loading a lot of drivers on start-up. This can occur, especially gradually over time, as applications and hardware are installed over time and with them come their various driver files.  You should remove unwanted drivers as part of the general speed up of the start-up.  This will also remove redundant drivers from being loaded for no reason and causing general clutter. I always like to keep everything neat and tidy and as simple as possible for my requirements.

BootPrefetchInitTime - The latter one 'BootPrefetchInitTime' can have high values if Windows 7 stores a lot of pre-fetch data. This is the historic property I mention above. In the past there were various pros and cons to adjusting the Prefetch values. However, with Windows 7 manipulation of the amount of Prefetch that is occurring is unnecessary and the default setup is the way things should be. Interestingly I found an article describing how this can be adjusted and what used to be done for Windows XP in particular under the following link and this is called 'show the pros and cons of disabling prefetch to speed up the boot time' found here. The key thing to remember is that Ive included this info for your vieweing pleasure, and it should NOT b e acted upon any further than simply reading the article and seeing what is inside your OS (the article has some interesting points on the registry, setting the Prefetch values, what they are, etc)

Improving Start-Up Times Via Removal Of Apps/Services

So....(to be continued on another day)

-- logs showing causes of slowness for critical/error events
-- msconfig use for startup apps
-- remove startup apps
-- current improved times

1 comment: