Here, you are introduced to the Windows Performance Toolkit. Discussed are the features of the Windows performance toolkit on the msdn website. You will be introduced to the Windows Performance Recorder UI (WPR-UI) and the Windows Performance Analyzer (WPA). You will learn how to use the WPR-UI to collect power data and how you can use the WPA to inspect that data.
- The Windows Performance Toolkit is a collection of performance monitoring tools. These tools are the Windows Performance Recorder, commonly called WPR. Which generates event tracing for Window's files. These are called ETL files that can then be analyzed using the Windows Performance Analyzer. Commonly called WPA. You'll find ETL files included in the exercise files for this course. Another tool which is useful for inspecting CPU and GPU activity is GPUView.
The Windows Performance Recorder has a user interface. This UI lets you select which types of Windows events you would like to log and keep track of. Even though there are a wealth of options we we only be selecting and focusing on CPU usuage, power usage GPU activity. An entire course could be dedicated to using the tools. But here we are only going to focus on the features we need in order to optimize an XNA game application of a simple sprite bouncing around the screen.
If you look in the top left corner of the screen you can see a number that is well over a 1,000. This is the FPS, the Frames Per Second that is being reported by FRAPS. FRAPS is a very popular free tool that shows the FPS of a game. Here we see a very high FPS. Now using the Windows Performance Recorder we are going to be generating ETL recordings that we are going to be inspecting in the Windows Performance Analyzer. Right now the XNA application is CPU bound.
CPU bound means the CPU is being utilized 100% of the time just to render that simple bouncing graphic. By the time we are done optimizing the application the CPU utilization will be significantly lower. Which means that power consumption of the application will be lower as well. The best part is that visually you won't be able to tell the difference. They key concept we will discuss here is Timer Tick Resolution Rate change. It is very common for game developers to change the Timer Tick Resolution Rate of the operating system from default of 15.6 milliseconds down to something smaller.
So that they can present frames at a faster rate. Their intention is to ensure a fluid user experience. Now, the unintended effect that this commonly has is that the power consumption dramatically increases on the system as a whole. And the application is consuming so many resources and keeping the CPU busy presenting frames that when a user does perform a user input that input must wait until resources are available. This causes longer user response times which means a poor user experience.
By the time we are done optimizing the XNA application we will see in GPUView that a frame is being rendered at very VSynch line. Which means the applications capped at 60 frames per second. VSynch stands for Vertical Synchronization. Which synchronizes the frame rate with the monitor refresh rate. What this means is that a frame will only be presented to the user based on the refresh rate of the monitor. So, once again we are not going to go over everything in the Windows Performance Toolkit, we are only going to focus on CPU utilization and the Timer Rick Resolution Rate change.
With these diagnostic tools and some efficient programming, you can reduce your app's power consumption while improving its response times. In this course, Thomas Pantels introduces a handful of tools used to measure and optimize power consumption. You will see demos on how to use the Intel Power Gadget, Windows Performance Toolkit, TypePerf, and SoC Watch, along with some simple coding tips for making any Windows app more energy efficient.
- Collecting and analyzing power data with Intel Power Gadget
- Implementing a rendering state machine
- Collecting and analyzing data with the Windows Performance Toolkit
- Understanding idle states, call stack walking, and thread activity
- Windows OS Timer Tick Resolution Rate change
- Optimization techniques to make your app power efficient
- Collecting, analyzing, and comparing data with Windows TypePerf and SoC Watch