Performance of Windows 7 and Notebooks


This article was sent to us by: RCG Infosoft at 01282010

1 Windows 7 » Performance of Windows 7 and Notebooks
Bookmark and Share

Rediscover the Fundamentals: It’s All About Performance

The single most important request customers have had about the next release of the Microsoft Windows operating system is flabbergasting from an engineering standpoint. Customers want Windows to run faster, on lesser hardware, using less system resources, while supporting all existing applications. Much less than they care about new features, Windows users users of your software included want the next version of the operating system to take better advantage of existing hardware and do everything increasingly faster.

Windows 7 on Netarticles

I, for one, expect Windows 7 to run smoothly on my 9-inch netarticle, “featuring” a single low-end 900-MHz processor, 1 GB of physical memory, and an extremely slow solidstate hard drive (SSD). In fact, if Windows 7 ran any slower on it than Windows XP I would be utterly disappointed.

Fortunately, after installing the Windows 7 Release Candidate, I was positively surprised by every possible aspect of my machine the system booted faster, applications launched faster, there was still some memory available after opening a few applications, and I could even install Microsoft Office and have some room left on the 16-GB SSD! With full certainty, I can say that Windows 7 has turned a machine that I was using as a brick or a coffee coaster into a useful mobile PC that I often take with me when I have no specific client engagement during the day that requires a more powerful machine and my back thanks me every day for its form and weight factors.

But that is not all. On a related note, users want to be able to use their mobile PC for an entire day without draining the battery or compromising for screen brightness or wireless connectivity. Users need the system to support larger screens, more connected hardware, and a variety of operating conditions and still retain the same reliability characteristics. Finally, users want the system to let them focus on their tasks, and for any background processing to remain minimal, regardless of how many new features are added between releases of the operating system.

Reaching these goals is not a task for operating system developers alone. A typical consumer runs dozens of third-party applications that have nothing to do with Microsoft, and he has several hardware devices plugged into the system that have third-party drivers and background services. Every time a user downloads some software from the Web, every time a user plugs in his new $10 USB mouse, every time a user opens a game a friend sent in an email message every time one of these things happens, the particular version of Windows running on the system loses control over the performance and reliability of the machine. This is why it takes a joint effort from you, fellow developers, to maintain a stable, reliable, fast, and efficient system for years to come, across multiple releases of Windows.

This article deals with some ways to instrument your applications and the system as a whole and diagnose performance and correctness problems that prevent your users from performing their day-to-day tasks. Along with examining troubleshooting and diagnostics tools, we’ll take a look at underlying improvements to background processing and power management on Windows, to see how our applications can cooperate with the system to deliver a better user experience.

Instrumentation and Diagnostics

Windows features a multitude of mechanisms that can assist you with the daunting task of diagnosing system-wide performance problems and troubleshoot hard-to-reproduce bugs. You already know that there’s an amazing ecosystem for developers on Windows but the reason there are so many troubleshooting tools and approaches is that the developers of Windows use them every day to ensure that the operating system we’re all using is fast and reliable.

Even if you don’t intend to use these tools right now to troubleshoot, monitor, or instrument your applications, you should plan your development accordingly so that maintenance programmers, system administrators, and support personnel can take advantage of the troubleshooting features Windows has to offer when your application is deployed in the field. The subsequent sections will show you how to accomplish some of these tasks. There are several topics that this article doesn’t spell out, but don’t despair fortunately, there is a vast amount of documentation and online material that can guide you through these features of Windows.

Note You might notice that some, if not most, of the features discussed in this section are not new to Windows 7. This might be surprising considering the title of the article and the fact that lots of interesting material was cut to leave room for this humble article. However, this reflects the authors’ deep conviction that understanding of instrumentation, monitoring, diagnostics, and troubleshooting tools and techniques is vital for any Windows developer, and especially so on Windows 7.

Performance Counters

Performance counters are a simple yet very powerful mechanism that has been part of Windows for more than 15 years. They provide monitoring information that can give you insight about the system’s performance as a whole, as well as the health of a particular component in a specific application. Performance counters, like many other diagnostic mechanisms in Windows, are exposed by system components but can be enhanced by individual frameworks or applications.

The architecture of the performance-counter mechanism is roughly the following. Objects that you categorize as classes or types are called performance objects or performance counter categories. Within each category you find performance counters these are the properties or fields of a class. Finally, like every class, there might be more than one instance of a performance object and that’s a performance counter instance. Here are some examples of useful performance counters:

  • Processor % User Time, % Privileged Time (instances for each logical processor)
  • Physical Disk Avg. Disk Queue Length (instances for each physical disk)
  • .NET CLR Memory # Bytes in All Heaps (instances for each managed application)
  • TCPv4 Connections Active (singleton)

Windows ships with dozens of performance counter categories, and external frameworks augment this set with their own diagnostic information. For example, ASP.NET features its own performance counters, Microsoft SQL Server has its own, and even individual applications might have performance counters for diagnostic and monitoring purposes.

The most obvious limitation of performance counters is that the information you can provide through this mechanism is restricted to numeric types only. For example, you can easily report the number of users logged on to your server, the percent of connections that were dropped, and even the rate of a physical event occurring. However, you can’t render a report containing strings or other complex data types, and the maximum nesting of the report is limited to the category instance counter hierarchy.

Despite these limitations, performance counters are an extremely popular and useful mechanism, primarily because the means to consume performance information ships with Windows and doesn’t require any additional installation which is extremely useful when diagnosing problems in the field. The Performance Monitor utility (perfmon, also accessible from the Administrative Tools area of the Control Panel) is your primary tool to work with performance counters. By adding performance counters to the main view, you can use the Line, Histogram, or Report views to see the data flowing live onto the screen, and then you can configure the sampling time interval for the counters of interest.

The best thing about performance counters is that you can access them remotely. If you have administrative privileges for a set of machines, you can use Performance Monitor to view performance counters from the comfort of your own desk and terminal. For example, you can overlay CPU utilization from multiple machines on the same performance graph and determine by a quick glance which machine is most loaded at any given instant.

Note Unfortunately, the performance counters database can sometimes get corrupted, especially if you are experimenting with performance counter categories of your own. In this case, a useful command-line utility called lodctr can help you to restore your performance counters database to its initial state, or even to import the performance counter database from another, similarly configured machine. For more information on this utility’s syntax, run lodctr with no arguments from a command line.

The performance counters infrastructure does not limit you to passive immediate observation of the data as it slides across your screen. Using Performance Monitors or using the built-in Windows APIs, you can log performance counter information in a variety of formats, including a compact, automatically rolling-over binary format as well as a CSV format or an SQL format. You can open the generated log files later at your convenience (from any machine) and view them in the Performance Monitor as if they were live.

Legal Disclaimer

Webworldarticles.com is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. Webworldarticles.com is a free information resource. If you suspect this article for any copyright infringement, please read the terms of service and contact us to investigate the problem.

Related Articles

1. Signed drivers under Windows 7
Is That Driver Signed? As we noted earlier in this article, Windows 7 requires that all driver packages be trusted before they...

2. Windows 7 file system FAT32 and NTFS comparison
Choosing a File System Whether you’re setting up a new disk or reformatting an existing one, the process of formatting e...

3. Creating a Performance Counter Log in Windows 7
To create a performance counter log, follow these steps: 1. Open Performance Monitor, and navigate to the Data Collector Sets node in the tree...

4. Use the Pan Gesture to Move an Object
With the pan gesture, you can control the scrolling of content in a scrollable area. Or you can apply the pan gesture to a specific object, moving it ...

5. Handling the WM GESTURE Message
To work with gestures, you’ll need to handle the WM_GESTURE messages that are sent to your application. If you are a Win32 programmer, you can c...

6. How Multitouch Works in Windows 7
New hardware and API elements in the Windows 7 operating system provide applications the ability to receive and handle touch and multitouch input. Thi...

7. Organize My Data Libraries in Windows 7
This article details the new functionality offered by Windows 7 Libraries. We’ll review the Windows Explorer changes that promote the new user e...

8. Changes Made to Windows Explorer in Windows 7
Changes Made to Windows Explorer in Windows 7 In Windows 7, Libraries address the problem of users’ data being stored all over the PC by...