Engineering Windows 7

Welcome to our blog dedicated to the engineering of Microsoft Windows 7

Continuing our discussion on performance

Continuing our discussion on performance

We've talked some about performance in this blog and recently many folks have been blogging and writing about the topic as well. We thought it would be a good time to offer some more behind the scenes views on how we have been working on and thinking about performance because it such an interesting topic for the folks reading this blog. Of course I've been using some pretty low-powered machines lately so performance is top of mind for me as well. But for fun I am writing this on my early holiday present--my new home machine is a 64-bit all-in-one desktop machine with a quad core CPU, discrete graphics, 8GB of memory, and hardware RAID all running a pretty new build of Windows 7 upgraded as soon as I finished the out of box experience. Michael Fortin and I authored this post. --Steven

Our beta isn’t even out the door yet and many are already dusting off their benchmarks and giving them a whirl. As a reminder, we are encouraging folks to hold on benchmarking our pre-production builds. Yet we’ve come to expect it will happen, and we realize it will lead many to conclude one thing or another, and at the same time we appreciate those of you who take the time to remind folks of the pre-ship status of the code. Nevertheless we’re happy that many are seeing good results thus far. We're not yet as happy as we believe we will be when we finish the product as we continue to work on all the fundamental capabilities of Windows 7 as well as all the new features folks are excited about.

Writing about performance in this blog is nearly as tricky as measuring it. As we've seen directional statements are taken further than we might intend and at the same time there are seemingly infinite ways to measure performance and just as many ways to perceive the same data. Ultimately, performance is something each individual feels is right--whether than means adequate or stellar might vary scenario to scenario, individual to individual. Some of the mail we've received has been clear about performance:

  • Boot-very very fast in all applications ( open-load applications) especially so many simultaneously!!!!! Hence, massive multicore ( quad-octa core cpu) , gpgpu for all!!!!!!!!!!!!
  • This is right time to do this properly, the users want speed, we'll give them speed.
  • i want to be able to run windows 7 extremely fast and still look good graphically on a asus aspire one netbook with these specs-1.5 ghz intel atom processor (single core) 1gb of ram
  • I hope that in addition to improvements in the gui and heart (I hope massive multicore + 64-bit + Directx 11 ..extreme performance, etc) for windows 7, modified the feature Flip 3d In Windows 7!!!!! Try to make a Flip 3D feature, really efficient and sensible in windows 7.
  • With regard to the performance thing, could you look at ways to reduce the penalty of having a lot of fonts installed.
  • From performance, boot up, explorer speed and UI experience , I hope the next version of windows delivers something new and innovating. I was playing with the new UI on the HP TouchPC and I have to say they did a great 1.0 job on the touch interface controls.
  • I do keep my fingers crossed for Windows 7 to be dramatically better in its performance than Windows Vista.
  • The biggest feature I see a lot of people wanting is performance.

You can also see through some of these quotes that performance means something different to different people. As user-interface folks know, perceived performance and actual performance can often be different things. I [Steven] remember when I was writing a portion of the Windows UI for Visual C++ and when I benchmarked against Borland C++ at the time, we were definitely faster (measured by seconds). However the reviews consistently mentioned Borland as being faster and providing feedback in the form of counts of lines compiled flying by. So I coded up a line count display that flashed a lot of numbers at you while compiling (literally flashy so it looked like it couldn't keep up). In clock times it actually consumed a non-zero amount of time so we got "slower" but the reviewers then started giving us credit for being faster. So in this case slower actually got faster.

There's another story from the past that is the flip side of this which is the scrolling speed in Microsoft Word for DOS (and also Excel for Windows--same dynamic). BillG always pushed hard on visible performance in the "early" days and scrolling speed was one of those things that never seemed to be fast enough. Well clever folks worked hard on the problem and subsequently made scrolling too fast--literally to the point that we had to slow it down so you didn't always end up going from page 1 to the end of the document just because you hold down the page down key. It is great to be fast, but sometimes there is "too much speed".

We have seen the feedback about what to turn off or adjust for better performance. In many ways what we're seeing are folks hoping to find the things that cause the performance to be less than they would like. I had an email conversation with someone recently trying to pinpoint the performance issues on a new laptop. Just by talking through it became clear the laptop was pretty "clean" (~40 processes, half the 1GB of RAM free, <5% CPU at idle, etc.) and after a few back and forths it became clear it was the internet connection (dial-up) that was actually the biggest bottleneck in the system. Many encourage us to turn off animations, graphics, or even color as there is a belief that these can be the root of performance. We've talked about the registry, disk space utilization, and even color depth as topics where folks see these as potential performance issues.

It is important to consider that performance is inherently a time/space tradeoff (computer science sense, not science fiction sense), and on laptops there is the added dimension of power consumption (or CPU utilization). Given infinite memory, of course many algorithms would be very different than the ones we use. In finite memory, performance is impacted greatly by the overall working set of a scenario. So in many cases when we talk about performance we are just as much talking about reducing the amount of memory consumed as we are talking about the clock time. Some parts of the OS are much more tunable in terms of the memory they use, which then improves the overall performance of the system (because there is less paging). Other parts of the system are much more about the number of instructions executed (because perhaps every operation goes through that code path). We work a great deal on both!

The reality of measuring and improving performance is one where we are focused at several "levels" in Windows 7: micro-benchmarks, specific scenarios, system tuning. Each of these plays a critical role in how we are engineering Windows 7 and while any single one can be measured it is not the case that one can easily conclude the performance of the system from a measurement.

Micro-benchmarks. Micro-benchmarks are the sort of tests that stress a specific subsystem at extreme levels. Often these are areas of the code that are hard to see the performance of during usage as they go by very fast or account for a small percentage of time during overall execution. So tests are designed to stress part of the system. Many parts of the system are subjected to micro-benchmarking such as the file system, networking, memory management, 2D and 3D graphics, etc. A good example here is the work we do to enable fast file copying. There is a lot of low level code that accounts for a (very significant) number of conditions when copying files around, and that code is most directly executed through XCOPY in a command window (or an API). Of course the majority of copy operations take place through the explorer and along with that comes a progress indicator, cancellable operation, counting up bytes to copy, etc. All of those have some cost with the benefit as well. The goal of micro-benchmarks is to enable us to best understand the best possible case and then compare it to the most usable case. Advanced folks always have access to the command line for more power, control, and flexibility. It is tempting to measure the performance of the system by looking at improvements in micro-benchmarks, but time and time again this proves to be inadequate as routine usage covers a much broader code path and time is spent in many places. For Internet Explorer 8 we did a blog post on performance that went into this type issue relative to script performance. At the other end of the spectrum we definitely understand the performance of micro-benchmarks on some subsystems will be, and should be, carefully measured --the performance of directx graphics is an area that gamers rely on for example. It is worth noting that many micro-benchmarks also depend heavily on a combination of Windows OS, hardware, and specific drivers.

Specific scenarios. Most people experience the performance of a PC through high level actions such as booting, standby/resume, launching common applications. These are topics we have covered in previous posts to some degree. In Engineering Windows 7, each team has focused on a set of specific scenarios that are ones we wanted to make better. This type of the work should be demonstrable without any elaborate setup or additional tools. This work often involves tuning the code path for the number of instructions executed, looking at the data allocated for the common case, or understanding all the OS APIs called (for example registry lookups). One example that comes to mind is the work that we have going on to reduce the time to reinsert a USB device. This is particularly noticeable for UFD (USB flash drives) or memory cards. Windows of course allows the whole subsystem to be plumbed by unique drivers for a specific card reader or UFD, even if most of the time they are the same we still have to account for the variety in the ecosystem. At the start of the project we looked at a full profile of the code executed when inserting a UFD and worked this scenario end-to-end. Then systematically each of the "hot spots" was worked through. Another example along these lines was playback of DVD movies which involves not only the storage subsystem but the graphics subsystem as well. The neat thing about this scenario is that you also want to optimize for the CPU utilization (which you might not even notice while playing back the movie) as that dictates the power consumption.

System tuning. A significant amount of performance work falls under the umbrella of system tuning. To ascertain what work we do in this area we routinely look at the overall performance of the system relative to the same tests on previous builds and previous releases of Windows. We're looking for things that we can do to remove operations that take a lot of time/space/power or things that have "grown" in one of those dimensions. We have build-to-build testing we do to make sure we do not regress and of course every developer is responsible for making sure their area improves as well. We left no stone unturned in terms of investigating opportunities to improve. One of the areas many will notice immediately when looking at the pre-beta or beta of Windows 7 is the memory usage (as measured by task manager, itself a measurement that can be misunderstood) of the desktop window manager. For Windows 7, a substantial amount of architectural work went into reducing the amount of memory consumed by the subsystem. We did this work while also maintaining compatibility with the Windows Vista drivers. We did similar work on the desktop search engine where we reduced not just the memory footprint, but the I/O footprint as well. One the most complex areas to work on was the improvements in the taskbar and start menu. These improvements involved substantial work on critical sections ("blocking" areas of the code), registry I/O, as well as overall code paths. The goal of this work is to make sure these UI elements are always available and feel snappy.

It is worth noting that there are broad based measures of performance as well that drive the user interface of a selection of applications. These too have their place--they are best used to compare different underlying hardware or drivers with the same version of Windows. The reason for this is that automation itself is often version dependent and because automation happens in a less than natural manner, there can be a tendency to measure these variances rather than any actual perceptible performance changes. The classic example is the code path for drawing a menu drop down--adding some instructions that might make the menu more accessible or more appealing would be impossible to perceive by a human, but an automated system that drives the menu at super human speed would see a change in "performance". In this type of situation the effect of a micro-benchmark is magnified in a manner inconsistent with actual usage patterns. This is just a word of caution on how to consider such measurements.

Given this focus across different types of measurement it is important to understand that the overall goal we have for Windows 7 is for you to experience a system that is as good as you expect it to be. The perception of performance is just as important as specific benchmarks and so we have to look to a broad set of tools as above to make sure we are operating with a complete picture of performance.

In addition to these broad strategies there are some specific tools we've put in place. One of these tools, PerfTrack, takes the role of data to the next level with regard to performance and so will play a significant role in the beta. In addition, it is worth reminding folks about the broad set of efforts that go into engineering for performance:

  • We’ve been building out and maintaining a series of runs that measure thousands of little and big things. We’ve been running these before developer check-ins and maintaining performance and responsiveness at a level above which all that self-host our builds will find acceptable. These gates have kept the performance and responsiveness of our daily builds at a high enough level that thousands have found it possible to run their main systems on Windows 7 for extended periods of time, doing their normal daily work.
  • We’ve been driving down footprint, reducing our service costs, improving the efficiency of key code paths, refactoring locks to improve scalability, reducing hangs, improving our I/O efficiency and much more. These are scenario driven based on real world execution paths we know from our telemetry to be common.
  • We’ve been partnering closely with the top OEMs, ISVs and IHVs. Our tools have been made public, we’ve held numerous training sessions, and we’ve been focusing heavily on shipping systems in an effort to insure customers get great performing systems out of the box, with great battery life too.
  • Within the Windows dev team, we’ve placed a simple trace capturing tool on everyone’s desktop. This desktop tool allows each person to run 24x7 with performance tracing enabled. If anything seems slow or sluggish, they can immediately save the last minute-or-so of activity and send it for automated analysis. Additionally, a team of people visually inspect the traces for new issues or issues not yet decipherable by our automation. The traces are incredibly rich and allow us to get to the root of top issues most of the time.
  • For all Pre-Beta, Beta and RTM users, we’ve developed a new form of instrumentation and have used it to instrument over 500 locations in the operating system and inbox applications. This new instrumentation is simple in concept, but revolutionary in result. The tool is called PerfTrack, and it has helped confirm our belief that the client benchmarks aren’t too informative about real user responsiveness issues.

Perftrack is a very flexible, low overhead, dynamically configurable telemetry system. For key scenarios throughout Windows 7, there exist “Start” and “Stop” events that bracket the scenario. Scenarios can be pretty much anything; including common things like opening a file, browsing to a web page, opening the control panel, searching for a document, or booting the computer. Again, there are over 500 instrumented scenarios in Windows 7 for Beta.

Obviously, the time between the Stop and Start events is meant to represent the responsiveness of the scenario and clearly we’re using our telemetry infrastructure to send these metrics back to us for analysis. Perftrack’s uniqueness comes not just from what it measure but from the ability to go beyond just observing the occurrence of problematic response times. Perftrack allows us to “dial up” requests for more information, in the form of traces.

Let’s consider the distribution below and, for fun, let's pretend the scenario is opening XYZ. For this scenario, the feature team chose to set some goals for responsiveness. With their chosen goals, green depicts times they considered acceptable, yellow represents times they deemed marginal, and red denotes the poor times. The times are in milliseconds and shown along the X axis. The Hit Count is shown on the Y axis.

Graph measuring responsiveness goals and real world data.

As can be seen, there are many instances where this scenario took more than 5 seconds to complete. With this kind of a distribution, the performance team would recommend that we “dial up” a request for 100+ traces from systems that have experienced a lengthy open in the past. In our “dialed up” request, we would set a “threshold” time that we thought was interesting. Additionally, we we may opt to filter on machines with a certain amount of RAM, a certain class of processor, the presence of specific driver, or any number of other things. Clients meeting the criteria would then, upon hitting the “Start” event, configure and enable tracing quickly and potentially send back to us if the “Stop” event occurred after our specified “threshold” of time.

As you might imagine, a good deal of engineering work went into making this end to end telemetry and feedback system work. Teams all across the Windows division have contributed to make this system a reality and I can assure you we’ll never approach performance the same now that we have these capabilities.

As a result of focusing on traces and fixing the very real issue revealed by them, we’ve seen significant improvements in actual responsiveness and have received numerous accolades on Windows 7. Additionally, I’d like to point out that these traces have served to further confirm what we’ve long believed t be the case.

This post provides an overview of the ways we have thought about performance with some specifics about how we measure it throughout the engineering of Windows 7. We believe that throughout the beta we will continue to have great telemetry to help make sure we are achieving our goals and that people perceive Windows 7 to perform well relative to their expectations.

We know many folks will continue to use stop watches, micro-benchmarks, or to drive automated tests. These each have their place in your own analysis and also in our engineering. We thought given all the interest we would talk more about how we measure things and how we're engineering the product.

--Steven and Michael

Leave a Comment
  • Please add 2 and 8 and type the answer here:
  • Post
  • This was once again one of the best posts in all Microsoft Blogs. I think you do a great job and do it the right way. Congrats!

    Windows 7 feels very snappy. I don't really care if it performs faster in benchmarks. I only care about percieved performance. The only two things that should/could be snappier are:

    - Hardware/driver related things (removing drivers, installing drivers, ...). Not important.

    - Resume after hibernate.

    - Explorer. Very important.

    Explorer still slows down when creating thumbnails. When I double click a video I expect WMP to open and play. But instead the green bar in the adress bar moves around and I have to wait 10+ seconds until the video starts. The same thing happens when I try to delete a video - Explorer just sits there for several seconds before the "Do you really want to"-dialog pops up. It looks like it's trying to create a thumbnail first (to display it in the dialog). Why can't it show the dialog first and then create the thumbnail?

    Anyway: I'm enjoying Win7 and the stuff I read here. You're doing it right!

  • *It seems just like Vista, Windows 7*

    corrected that mistake :P

  • @Asesh

    even if the bench is positive ,

    is stupid to do bench now  6801,6956etc etc

  • *Vista and server 2008*

    same typing mistake correction from my first post.

    Why can't we edit our post after we have posted once?

  • A clean install of Windows is, in my opinion, plenty fast today.  But use that same installation of Windows for a year, installing and upgrading applications in a typical usage pattern, and performance degrades.

    Do you have any benchmarks or metrics that cover the change in performance over time?

    In my opinion the need to re-pave a machine every year or two to regain performance is Windows's biggest drawback.

  • Is the telemetry going to be opt-in/opt-out? I know there are plenty of people who will have privacy concerns with it (no matter how anonymous it is).

  • I love this blog! Such cool insight.

    If I may contribute my 2c... There are 2 things that annoy the heck out of me performance-wise and they haven't been mentioned previously. I'd like to vent.

    1) CD/DVD spin-ups. When you leave a CD in the drive and you're not using it, programs like media players and Explorer will hang periodically to spin up the disc before displaying menus or whatever even when i'm not trying to access the disc. It still wants to querey everything and make sure its still there, I guess. It annoys me. I usually keep cds out of the drive when i'm not actively using them because of this.

    2) When the computer starts doing some background operation that kills the performance, like a virus scan, i usually hit CTRL+SHIFT+ESC to pull up Task Manager/Process Explorer to investigate what it is that's taxing the system. To my extreme annoyance, the task manager window doesn't come up until whatever it is that was taxing my system has finished. Then, obviously the task manager can show me nothing of importance.

    Its not so much that I can't see what it was, but that Windows doesn't make ME the highest authority for issuing nstructions aside from the most critical tasks. To me, that's the key to perceived performance.

  • briantist

    "4) Windows 7 needs to monitor its own performance and make suggestions to the user when problems occur, for example messages about disk usage, defragmentation, even adding extra memory - using real world calculations such as the time, cost and simplicity."

    I think this is a very intresting point, we see that in Vista a little bit(Aero on or off like the Benchmark, Index say it)

    So you can improve that in Seven(and please print on the Pack that you sell "Seven" and not "7" ;) to get spezified performance settings right from installation(user dont need to do something)...

    And now something i wish otherwise:

    1. Activate: Start Explorer window in its own Process.

    2. Dont activate: Hide know file extensions.

  • @hicks

    1. They have done that in Windows 7 Build 6801...

  • After few months of usage, the performance still continues to go down. (The PDC build still on one of my desktops has after 1.5 months slowed down at startup horribly.) Any efforts in that regard? Why does it slow down even after restoring the registry and clearing up disk space and defragging? Are you testing builds on any systems for long-term performance impacts (difficult because the builds themselves keep improving in performance)?

    Another topic I am deeply concerned about is Windows Live. I fear the design and engineering principles of Windows 7 aren't being applied to the Windows Live Essentials desktop suite. It continues to suck in performance and disk space areas, resulting in an inferior experience. Just today, the beta refresh/RC1 was released and I'm totally displeased after installing it on my laptop which runs Windows 7 very fast. Windows Live desktop applications are in every way, part of the OS (even though they may not be shipping with it).

    hicks has a point too that is really happening right now on my Windows 7 6956 install. Windows Media Player starts up quickly but takes long before anything can be done because it is spinning up and trying to access my CD/DVD drives as well as some USB flash drives (for AutoPlay and device syncing).

    Lastly, the aspect of performance (maybe perceived) where Vista angered me the most was the huge logon and shutdown time whenever updates were installed. Why should I bother what Windows does to "configure" updates, I do not want to wait a second longer for Windows to configure updates because previous versions did not require me to wait. I don't need to know why or how the new servicing stack betters the reliablity and stability of the system. People won't report on this issue during the beta because very few updates/hotfixes are released for development builds.

  • @someone:

    Cant agree with any of this points, Windows 7 Build 6801, running now from PDC and its still running with same performance...also Live Apps have no impact to system performance...

  • ...the way you have networked all the machines to troubleshoot issues is awesome...

    ...seems like such a simple idea now...

    ...but it is certainly going to change things...

    ...way to go with that implementation...

    ...im sure it was complicated...

    ...very exciting times...

  • Quick intro...I work for Mike Fortin on the client performance team.

    @gsnedders

    The PerfTrack telemetry is part of the Customer Experience Improvement Program (see http://www.microsoft.com/products/ceip/en-us/default.mspx) and thus will be opt-in when we release.

    @Someone, bluefisch200 and others

    We call this problem "Performance degradation over time" internally.  .  While many people don't experience this (myself included), we do recognize that some of our customers do.  I've seen this in relatives machines (yes, like many, I get called on for help) and I've heard enough reports from friends and acquaintances to understand that it's a real issue.  We've also learned that there are many factors contributing to the overall problems in different degrees in different systems.  These factors include Malware, poorly behaved drivers or services, and some Windows issues which we've addressed in Win7 as well as some which we’re still working on.

    The PerfTrack telemetry will help us understand more about this area to improve both Windows and the ecosystem much like the Windows Error Reporting system has improved application and systems crashes and hangs over the last several years.

  • Yes, indeed very exiting to read this.

    Do you realize that w7 will be the 1st Windows OS ever to have better performance (and lower requirements) than the previous version?

    This is a revolution at MS if you ask me.

    Talking about requirement you still didn't talk about that. Will improved performance reduce req.? (I'd love to run w7 on my 6Y-old PC)

    Technical performance (or efficiency) is when the OS doesn't slow down a process from a 3d party app and interracts with it as fast as possible (opening files etc).

    The problem we see today is that some softwares and scripts slow down the system outside their normal area of action. I'm thinking of scripts on some websites more specificaly. One interresting way to improve performance and maintain resource availability could be to have a strategy to combat rogue codes. Especialy when the "close" button has been pressed on the app window.

    Percieved performance is not realy "performace" and is less important as soon as we have the option to tweak the UI.

    Jembe wrote: " 'animate windows when minimizing and maximizing'. ... I think this setting should be disabled by default in Windows 7; it will greatly improve perceived performance for the end user."

    Then Steven wrote:"  I was speaking with one of the many reviewers at our reviewer's workshop and their point used the same setting, but drew the opposite conclusion.  This person said "there are settings like window animation that I know technical people say they turn off for improved performance, but you need to leave those on and add more of them--performance is not just speed, but also the perception of being in control and feedback""

    ????

    I don't know to whom you was talking with but that had to be pretty wierd poeple.

    Windows animation tire the brain, create useless visual events, are against philosophy of work efficiency. It reminds me the "go-slow" in the administration of New-New-York in Futurama: Officers has to stand on a levitating platforms which move them from one room to another at slower speed than they would have by walking. The goal of the administration being to be slow as we all know. Sure like that Windows fit perfectly for these places! ;)

    Seriousely if it's better for advanced users, it must be also for normal users IMO.

  • @Someone, bluefisch200 and others in addition to DavidFie's reply...

    For the tech-savvy readers who have been working on 6801, one thing you could do is compare your current 6801 installation to a clean install.  Just open up taskmgr and look at the process count, memory, cpu utilization and compare that to the baseline 6801.  While this is some "work" for folks on the beta, it would also be instructional as we learn together how to better understand and act on the feedback.

    As DavidFie said we understand some of the causes and a great many of course are beyond our direct influence.  Personally, I was exchanging mail with someone this morning who was experiencing excessive disk i/o and it became clear that it was not a feature of Windows but a function of a program that was clearly doing something that this person did not intend.  The ability to diagnose this by using the reliability monitor in Windows Vista was a new tool in the toolbox so to speak.

    Anyone is welcome to send me the before and after taskmgr listings for 6801 and I will be more than happy to learn from them (I can't promise a full support/diagnosis if I get a lot of these).

    --Steven

Page 2 of 9 (129 items) 12345»