# Sampling CPython with WindowsPerf

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/laptops-and-desktops/windowsperf_sampling_cpython/)
- [CPython Sampling Example Overview](https://learn.arm.com/learning-paths/laptops-and-desktops/windowsperf_sampling_cpython/windowsperf_sampling_cpython/)
- [WindowsPerf sample example](https://learn.arm.com/learning-paths/laptops-and-desktops/windowsperf_sampling_cpython/windowsperf_sampling_cpython_example_1/)
- [WindowsPerf record example](https://learn.arm.com/learning-paths/laptops-and-desktops/windowsperf_sampling_cpython/windowsperf_sampling_cpython_example_2/)
- [Next Steps](https://learn.arm.com/learning-paths/laptops-and-desktops/windowsperf_sampling_cpython/_next-steps/)

## About this Learning Path

|  |  |
| --- | --- |
| Skill level: | Introductory |
| Reading time: | 30 min |
| Last updated: | 12 Aug 2026 |

|  |  |
| --- | --- |
| Author: | Przemyslaw Wirkus , Arm<br>[GitHub](https://github.com/PrzemekWirkus)<br>[LinkedIn](https://linkedin.com/in/przemyslaw-wirkus-78b73352) |
| Arm IP: | [Cortex-A](https://support.arm.com/?tab=compute-ip&Product%20Type=Application%20Processors) |
| Tags: | [Performance and Architecture](https://learn.arm.com/tag/performance-and-architecture/) [Windows](https://learn.arm.com/tag/windows) [WindowsPerf](https://learn.arm.com/tag/windowsperf) [Python](https://learn.arm.com/tag/python) [perf](https://learn.arm.com/tag/perf) |

### Who is this for?
This is an introductory topic for developers keen to understand sampling and who are new to the Arm architecture.

### What will you learn?
After completing this Learning Path, you'll be able to perform the following tasks:
- Use WindowsPerf with native Windows on Arm workload
- Understand the basics of sampling
- Explore the WindowsPerf command line
- Build CPython from sources for Windows on Arm ARM64 target

### Prerequisites
Before starting, you'll need the following prerequisites:
- Windows on Arm desktop or development machine with [WindowsPerf installed](https://learn.arm.com/install-guides/wperf/)
- Windows x86_64 desktop machine with [Visual Studio 2022 Community Edition](https://visualstudio.microsoft.com/vs/) installed.

### Summary
You’ll build a debug CPython for Windows on Arm, then use WindowsPerf to measure a Python workload. First, you’ll pin `python_d.exe` to one core, run counting and sampling, and locate hot runtime code. Then, you’ll also use `record` and `-c` to launch the interpreter with arguments, creating repeatable measurements that distinguish aggregate counts from sampled locations.

### Sampling CPython with WindowsPerf

- [Introduction](https://learn.arm.com/learning-paths/laptops-and-desktops/windowsperf_sampling_cpython/)
- [CPython Sampling Example Overview](https://learn.arm.com/learning-paths/laptops-and-desktops/windowsperf_sampling_cpython/windowsperf_sampling_cpython/)
- [WindowsPerf sample example](https://learn.arm.com/learning-paths/laptops-and-desktops/windowsperf_sampling_cpython/windowsperf_sampling_cpython_example_1/)
- [WindowsPerf record example](https://learn.arm.com/learning-paths/laptops-and-desktops/windowsperf_sampling_cpython/windowsperf_sampling_cpython_example_2/)
- [Next Steps](https://learn.arm.com/learning-paths/laptops-and-desktops/windowsperf_sampling_cpython/_next-steps/)
