You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/laptops-and-desktops/win-resource-ps1/how-to-1.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,12 @@ layout: learningpathall
7
7
---
8
8
9
9
## Overview
10
-
System resource usage provides an approach to understand the performance of an application as a black box. This Learning Path demonstrates how to sample system resource usage using a script.
10
+
To understand how well your application performs, you can measure its system resource usage (such as CPU time and memory) without needing to look inside the code. In this Learning Path, you'll learn how to collect resource usage data using a simple script. This helps you compare performance between different builds and see how efficiently your system runs each version.
11
11
12
12
The example application you will use is FFmpeg, a tool set that performs video encode and decode tasks. You will run the same tests with both the x86_64 binary (using Windows instruction emulation) and the Arm64 native binary on a Windows on Arm computer.
13
13
14
14
## Download the packages
15
-
16
-
You don't need to build FFmpeg from scratch—just grab the ready-made binaries and get started.
15
+
You don't need to compile FFmpeg from source. You can download the pre-built binaries to begin your testing:
17
16
18
17
- First, download the [FFmpeg x86_64 package](https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2025-07-31-14-15/ffmpeg-n7.1.1-56-gc2184b65d2-win64-gpl-7.1.zip).
19
18
- Next, download the [FFmpeg Arm64 native package](https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2025-07-31-14-15/ffmpeg-n7.1.1-56-gc2184b65d2-winarm64-gpl-7.1.zip).
@@ -23,20 +22,19 @@ You don't need to build FFmpeg from scratch—just grab the ready-made binaries
23
22
Once you've downloaded both packages, unzip them. You'll find the binaries in the `bin` folder inside each package. The x86_64 version is for emulation, while the Arm64 version runs natively on your Windows on Arm device. Double-check the folder names so you don't mix them up.
24
23
25
24
{{% notice Note %}}
26
-
It's a good idea to create a separate folder for each version. Make a note of where you put both `ffmpeg.exe` and `ffplay.exe` for each version—you'll need these paths soon to run your tests and compare results.
25
+
It's a good idea to create a separate folder for each version. Make a note of where you put both `ffmpeg.exe` and `ffplay.exe` for each version as you'll need these paths soon to run your tests and compare results.
27
26
{{% /notice %}}
28
27
29
28
Now you're set up with both versions of FFmpeg. Next, you'll use these binaries to encode a video and see how each one performs.
30
29
31
30
## Download the video source
32
31
33
-
For this test, you'll use a sample video called RaceNight. Download it from [this public dataset](https://ultravideo.fi/video/RaceNight_3840x2160_50fps_420_8bit_YUV_RAW.7z).
32
+
For this test, you'll use a sample video called RaceNight. Download it from this[RaceNight public dataset](https://ultravideo.fi/video/RaceNight_3840x2160_50fps_420_8bit_YUV_RAW.7z).
34
33
35
34
Unzip the package and make a note of the path to the `.yuv` file inside.
36
35
37
36
## Encode the video
38
-
39
-
The video you just downloaded is in YUV raw format, which means it's uncompressed and doesn't need decoding to play. To really test your system, you'll use FFmpeg to compress the video with the x265 encoder and convert it to an `.mp4` file.
37
+
The video you downloaded is in `.yuv` raw format. This means it's uncompressed and ready for processing, so no decoding step is needed. To test your system's performance, you'll use FFmpeg to compress the video with the x265 encoder and convert it to an `.mp4` file. This workflow lets you measure how efficiently each FFmpeg binary handles video encoding on your Windows on Arm device.
40
38
41
39
Assuming everything is in your current directory, open a terminal and run this command:
Make sure to update the paths to `ffmpeg.exe` and the YUV video file to match where you saved them.
46
+
Make sure to update the paths to `ffmpeg.exe` and the `yuv.` video file to match where you saved them.
49
47
{{% /notice %}}
50
48
51
-
This command resizes the video and compresses it into an MP4 file using H.265 encoding (via the x265 encoder). The `-benchmark` option shows performance stats while the encoding runs. When it's done, you'll have a new file called `RaceNight_1080p.mp4`.
49
+
This command resizes the video and compresses it into an MP4 file using H.265 encoding (using the x265 encoder). The `-benchmark` option shows performance stats while the encoding runs. When it's done, you'll have a new file called `RaceNight_1080p.mp4`.
52
50
53
51
Try running the command with both the x86_64 and Arm64 versions of FFmpeg. Then, compare the results to see which one is faster.
Check out the last line in each output—the run time and frames per second show how each build performed. The Arm64 version is much faster, thanks to running natively on your hardware.
105
+
Check out the last line in each output. The run time and frames per second show how each build performed. The Arm64 version is much faster, thanks to running natively on your hardware.
Copy file name to clipboardExpand all lines: content/learning-paths/laptops-and-desktops/win-resource-ps1/how-to-2.md
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,12 @@ weight: 3
6
6
layout: learningpathall
7
7
---
8
8
9
-
## Sample video decoding resource usage
9
+
## Analyze resource usage during sample video decoding
10
10
11
-
To monitor resource usage during video decoding, use the following PowerShell script. This script starts the decoding process, periodically records CPU and memory statistics, and saves the results to a CSV file for analysis.
12
11
13
-
Open your code editor, copy the content below, and save it as `sample_decoding.ps1`.
12
+
To monitor resource usage during video decoding, use the following PowerShell script. This script starts the decoding process, periodically records CPU and memory statistics, and then saves the results to a CSV file for analysis.
13
+
14
+
Open your code editor, copy the content below, and save it as `sample_decoding.ps1`:
14
15
15
16
```PowerShell { line_numbers = true }
16
17
param (
@@ -114,24 +115,23 @@ Run the script:
114
115
Set-ExecutionPolicy -Scope Process RemoteSigned
115
116
.\sample_decoding.ps1
116
117
```
117
-
118
-
A video starts playing and completes in 3 minutes. When finished, you can find the results file `usage_log.csv` in the current directory.
118
+
When you run the script, the video plays for about three minutes. After playback finishes, you'll find the results file named `usage_log.csv` in your current directory. Open this file with a spreadsheet application to review and analyze the recorded resource usage data.
119
119
120
120
{{% notice Note %}}
121
-
Script execution may be blocked due to security policy configuration. The `Set-ExecutionPolicy` command allows local scripts to run during this session.
121
+
Script execution might be blocked due to security policy configuration. The `Set-ExecutionPolicy` command allows local scripts to run during this session.
122
122
{{% /notice %}}
123
123
124
-
### Script explanation
124
+
##Understand what the script does
125
125
126
126
The `param` section defines variables including the binary path, video playback arguments, sampling interval, and result file path. You can modify these values as needed.
127
127
128
-
Lines 15-26 check and modify the binary file attributes. The binaries in use are downloaded from the web and may be blocked from running due to lack of digital signature. These lines unlock the binaries.
128
+
Lines 15–26 check whether the binary file is blocked by Windows security settings. When you download executables from the web, Windows may prevent them from running if they lack a digital signature. This section attempts to unlock the binary using the `Unblock-File` command, allowing the script to run the application without security restrictions.
129
129
130
130
Line 41 retrieves all child processes of the main process. The statistical data includes resources used by all processes spawned by the main process.
131
131
132
132
The `while` section collects CPU and memory usage periodically until the application exits. The CPU usage represents accumulated time that the process runs on the CPU. The memory usage shows the size of memory occupation with or without shared spaces accounted for.
133
133
134
-
### View results
134
+
### View the results
135
135
136
136
The output below shows the results from running the x86_64 version of `ffplay.exe`:
137
137
@@ -150,5 +150,4 @@ Timestamp,CPU Sum (s),Memory Sum (MB),Memory Private Sum (MB),CPU0 (s),Memory0 (
The sample result file uses CSV (comma-separated values) format. You can open it with spreadsheet applications like Microsoft Excel for better visualization and create charts for data analysis.
153
+
The sample result file is in CSV (comma-separated values) format. Open it with a spreadsheet application such as Microsoft Excel to view the data in a table. You can use built-in chart tools to visualize CPU and memory usage over time, making it easier to spot trends and compare performance between Arm64 and x86_64 versions.
Copy file name to clipboardExpand all lines: content/learning-paths/laptops-and-desktops/win-resource-ps1/how-to-3.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
-
title: Measure power usage
2
+
title: Measure power usage on Windows on Arm with PowerShell
3
3
weight: 4
4
4
5
5
### FIXED, DO NOT MODIFY
6
6
layout: learningpathall
7
7
---
8
8
9
-
## Sampling battery status
9
+
## Sample the battery status
10
10
11
11
Querying battery status provides a way to measure power usage without an external power meter. Battery monitoring is also convenient because data collection and logging can be automated.
12
12
@@ -77,7 +77,7 @@ A video starts playing and completes in 30 minutes. When finished, you can find
77
77
78
78
The script collects remaining battery capacity and discharge rate periodically. You can track the battery remaining capacity to understand the power consumption patterns.
79
79
80
-
### View results
80
+
### View the results
81
81
82
82
The output below shows the results from running the x86_64 version of `ffplay.exe`:
The sample results file is in CSV format. You can open it with spreadsheet applications like Microsoft Excel for better visualization and to plot data analysis charts.
101
101
102
102
Battery monitoring provides an effective way to measure power consumption differences between x86_64 and native Arm64 applications. By comparing discharge rates, you can quantify the power efficiency advantages that Arm processors typically demonstrate for video decoding workloads.
103
+
104
+
## Wrapping up and next steps
105
+
106
+
You’ve measured power usage on your Windows on Arm device and can now compare results across builds to see how native Arm64 performance affects battery life. Sharing your findings with the Arm developer community helps others optimize applications for Windows on Arm.
0 commit comments