I’ve been reading through the Windows 7 Developer Guide. I like this document; it is tilted more towards information than hype, and is readable even for non-developers. There are things mentioned which I had not spotted before.
One example is triggers in the service control manager. There was actually a PDC session which covered this, among other things, under the unexciting title Designing Efficient Background Processes (PowerPoint). If you check out the slides, you’ll see that this is actually something significant for Windows users. It is an attempt to reduce all that stuff that runs whether or not you need it, increasing boot time and slowing performance. Apparently some people are so upset with the time it takes Windows to boot that they are threatening to sue; so yes, this does matter.
Services are applications that run in the background, usually without any visible interface. They consume system resources, so it makes sense to run them only when needed. Unfortunately, many services run on a “just in case” basis. For example, if I check the services on this machine I see I have one running called Apple Mobile Device, just in case I might connect one. It is using 4MB of RAM. However, I never connect an Apple device to this machine. I’m sure it was installed by iTunes, which I rarely use, though I like to keep up-to-date with what Apple is doing. So every time I start Windows this thing also starts, running uselessly in the background.
According to Vikram Singh, who took the PDC session, adding 10 typical 3rd party services to a clean Vista install has a dramatic effect on performance:
- Boot time: up by 87% (24.7 to 46.1 seconds)
- CPU time when idle: up by six times (to 6.04%)
- Disk Read Count: up by three times (from 10,192 to 31,401 in 15 seconds)
Service triggers are an attempt to address this, by making it possible to install services that start in response to specific events, instead of always running “just in case”. Four trigger types are mentioned:
- On connection of a certain class of device
- On connection to a Windows domain
- On group policy refresh
- On connection to a network (based on IP address change)
In theory then, Apple can rewrite iTunes for Windows 7, so that the Apple Mobile Device service only starts when an Apple device is connected. A good plan.
Now, I can think of three reasons why this might not happen. First, inertia. Second, compatibility. This means coding specifically for Windows 7, whereas it will be easier just to do it the old, compatible way. Third, I imagine this would mean faster boot, but slower response when connecting the device. Apple (or any third party) might think: the user will just blame Windows for slow boot, but a slow response when connecting the device will impact the perceived performance of our product. So the service will still run at start-up, just in case.
Still, I’m encouraged that Microsoft is at least thinking about the problem and providing a possible solution. We may also benefit if Microsoft tweaks some of its own Windows services to start on-demand.