In this introduction to the built-in utility called Typeperf, you will be shown how the tool comes with Windows OS and what it does. You will be shown the features, the data it collects, the granularity at which it collects it and the relevant power data that it gives. You will be shown why Memory bandwidth, C state, P state and GT state residency info from the tool is helpful in power profiling. Lastly, you will be shown the script command that can be used to collect many different performance metrics.
- Windows TypePerf is a built in tool that comes with Windows operating system starting all the way back from Windows XP. It is located in your c drive/windows/system32 folder. This tool writes performance counter data to either your Command window or a supported log file. There are a lot of command line options available. Here we can see the -cf command line option where we simply specify a file name that contains all the counter paths that we want to monitor.
This file will look something like this. Where we specify on each line the path to the counter that we want data for such as disk write time. If we scroll down the text file we can see other counters specified. Such as C3 Time. This file is called TypePerfInput.txt and is included in the exercise files. If you don't have access to those then just pause the video and copy what you see here into your own TypePerfInput.txt file.
We will be running this tool on two applications that we previously optimized. The first is the Direct X 11 jigsaw puzzle. And the other is the XNA bouncing sprite example. After we are done running the tool it's going to generate a log file which looks something like this. And we can see in one of the columns the C3 State Transitions. There are a lot of columns in this log file but we are only going to focus on the columns that are of interest to us. After you become more familiar with the tool I highly recommend looking at all of the columns to obtain more information about your own application.
The columns of interest that we will look at will be based off a TypePerf criterion. Which is a guideline that tells us if our application is consuming too many system resources. For example, if I see the processor interrupt rate over 7,000 a second then that is a red flag. Why is the application having such a high interrupt rate? If my CPU utilization is around 70% total then that is cause for concern. What is causing the CPU utilization to be so high? If you see a scenario like this is your log files then this is a red flag and you should investigate further.
Once we are done post-processing the data we are going to be obtaining charts like the ones shown here on this slide. On the left we are going to have the non-optimized version and we can see that the C3 State Transitions are really high. On the right side we will have the optimized charts which you can see shows a significantly lower C3 State Transition rate. This correlates to the bouncing sprites power consumption. The more C3 State Transitions there are the more the CPU is being woken up from that sleep state.
This means the CPU is consuming more power. So, less C3 State Transitions equals less power being consumed by the application.
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