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

Tuesday, August 3, 2010

New Software Releases (Ubuntu-10.04, Firefox-4.0Beta2/3 & Netbeans6.9.1)!!!

Just a short/quick post to note that it seems to be a good time for software releases at the moment:
  • The latest version of Ubuntu, 10.04 (Lucid Lynx), is an LTS(Long Term Support) version, and was released on April 29, 2010. Woot!!! Woot!!! Woot!!! 
  • Firefox released the new Version 4 Beta a few weeks ago and now they've also released an update (i.e: Firefox 4.0 Beta 2....update....and Beta 3 came out on the 11th Aug), here's a link to the release notes and some interesting info: http://www.mozilla.com/en-US/firefox/4.0b2/releasenotes/
  • Netbeans has released the new 0.0.1 version release of Netbeans 6.9.1. The release notes are at: http://netbeans.org/community/news/show/1488.html.
Personally when it comes to large releases from companies I trust (FF, etc) I'm happy to use Beta versions on my PC's and Laptop. So I have a tendency to upgrade to the next version of 'most' bits of software (FF, Linux, JSE/JDK, JEE, etc). Regardless of new versions or even the use of Beta's but I tend to find that I'm OK and don't hit bad bugs from upgrading to early. That's good. So here's my opinions based on actual use of these tools and the new Betas/versions (well FF anyways....bit lazier so far on Ubuntu upgrades.... :-) )

Netbeans 6.9.1 Release

- Release Notes Overview: http://netbeans.org/community/news/show/1488.html

- Further Release Notes 6.9 Overview: http://netbeans.org/community/releases/69/

- List of Bug Fixes For The 6.9.1 Version: http://wiki.netbeans.org/NetBeans6.9PatchesInfo. This contains a list of the bugs fixed in the point release.

- And some EVEN better release notes for 6.9.1 August 4th 2010 Release: http://netbeans.org/community/releases/69/relnotes.html. These release notes kick ass in their detail. I reference these below for the list of some of the changes.


What's New in 6.9.1 - A more detailed list from above.

  • Availability of the latest IDE bundled with JavaFX SDK 1.3.1
  • Improvements to the JavaFX debugger
  • Important usability issues fixed in the JavaFX Composer and Editor
  • Critical bug fixes made to other modules since the 6.9 final release

The following updates to the 6.8 release included in version 6.9 also apply to 6.9.1:
  • JavaFX Composer to simplify and visualize JavaFX development
  • Support for Equinox and Felix OSGi frameworks in NetBeans Platform
  • Spring Framework 3.0 library support
  • Java CardTM 3 Connected
  • Rails 3.0 Beta support
  • PHP Zend Framework support
  • Support for JSR-299, Contexts and Dependency Injection (CDI)
  • Additional Enhancements are listed on the NetBeans IDE 6.9 New and Noteworthy page.
Note: The Java TM SE Development Kit (JDK) 5.0 is not supported on any platform for this release. You must have JDK 6.0 on your system to install and run NetBeans IDE 6.9.1.

Ubuntu Downloads and Free Install CD's


Firefox4.0-Beta2-Updates/New Functionality

- The following link shows the updates and the changes to the functionality from Beta 1 to 2. http://www.mozilla.com/en-US/firefox/beta/features/#feature-switch

- Furthermore I'm always interested in performance improvements. FF4Beta2 works on improving JavaScript, which given the state of the Web in our 'Web 2.0' fancy-shmancy world we live in is now an important feature to improve the speed of: http://blog.mozilla.com/dmandelin/2010/07/19/jagermonkey-update-getting-faster/. And so how does it get this extra performance. Well in a bunch of ways, bug fixes, perf., improvements, etc., etc., etc., but it also points out in dmandelin's blog that they used Ropes for improving the performance of Strings in JavaScript. The primary improvements going to occur when you do a lot of adds, removes from inside the middle of a string, and where in the normal case since a String is immutable you's need to make a new copy of inserts etc. Which gives you at least O(n) performance but Ropes convert a String to a tree structure so an insert in the middle of a string simply points a node to a new location of the new bit of the string we are adding. performance at O(1)!!! Beat that!!! Before you get to excited keep in mind you need to understand WHEN these are to be used or else you'll cost yourself performance but in the right case Speed improvements here we come. Something to keep in mind for the future if I ever need to perf., tune some code manipulating Strings heavily.



Check out http://en.wikipedia.org/wiki/Rope_%28computer_science%29 for an overview discussion of Strings vs. Ropes.