No project description provided
Project description
Python interface to CPU counters on Linux
Or, a minimal wrapper around the py-perf-event2 Rust crate, using the Linux perf subsystem.
To install: pip install py-perf-event
Example
from py_perf_event import measure, Hardware
[instructions1] = measure([Hardware.INSTRUCTIONS], sum, range(1_000_000))
print(instructions1)
[instructions2] = measure([Hardware.INSTRUCTIONS], sum, range(10_000_000))
print(instructions2)
assert instructions1 > 1_000_000
assert 7 < (instructions2 / instructions1) < 15
Other usage
See the tests for more examples.
Until more docs are available, you can use the underlying Rust libraries docs to see what fields are available on the Hardware and CacheId/CacheOp/CacheResult classes.
Changelog
- 0.2: Exposed
Rawevents. - 0.1: Initial, very minimal release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_perf_event-0.2.0.tar.gz.
File metadata
- Download URL: py_perf_event-0.2.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58d5db8c1193a6aecfd5bf986a47529c28d77b0eb611a1d216faf88af8ec139d
|
|
| MD5 |
80cec2c2562cba437371793c992279ca
|
|
| BLAKE2b-256 |
64a0c896a7aa17614f7e9aff83754b5b06a609f2dbe58171d633e1cba54fccdf
|
File details
Details for the file py_perf_event-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: py_perf_event-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6d5def379c267487b265671ec2495f9b4e3d507deea996b27ef55469d8b16e9
|
|
| MD5 |
5344ad072fcc09b79a07a7f4c9f4dcb2
|
|
| BLAKE2b-256 |
9b98d1b99b2bfa8a0fda83c294c43b881790469b8133f799e4ec6cc62e6fec57
|
File details
Details for the file py_perf_event-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: py_perf_event-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6629b918718fd3a779ed019d8f40c2fb85b8a1a849935705b6bdff9a9cb808e
|
|
| MD5 |
6cb52a9982c9c55c0a3dda038752ad48
|
|
| BLAKE2b-256 |
934f8a48b6e338e45acf1861eb67d97abaa3d0bbc2f28c25879049531afcae25
|