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.
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.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
py_perf_event-0.1.0.tar.gz
(7.5 kB
view details)
Built Distributions
File details
Details for the file py_perf_event-0.1.0.tar.gz
.
File metadata
- Download URL: py_perf_event-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98eb387c32e290e08bcc93153881b5cbadb2bf6b305c8812d4bc0204ce859ad6 |
|
MD5 | 3ed69a896ce2371bd1d866a15b38401c |
|
BLAKE2b-256 | e2bc1b6557b555be2ca73a3bbb052ff1ead8b08cf6d7ecbdacca88fa933529fc |
File details
Details for the file py_perf_event-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: py_perf_event-0.1.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 | 72f9f4ce7c10f8a488f0a672b326bcbb3c53364c5ea2b6a2606f1535dc9fa1fc |
|
MD5 | 174816990d554f76d2d79a8d015c4fec |
|
BLAKE2b-256 | 97ac437f8c3046850d97b7ba5015abf05be1ec40f59156932c072e6fb10e80ca |
File details
Details for the file py_perf_event-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: py_perf_event-0.1.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 | 6969c9acbb030045dd4a5119d8767518e2a011bba1d5355df5a490200d29430e |
|
MD5 | 383e59507d8ffd7523e42755719d337b |
|
BLAKE2b-256 | 412a207a263cd9f55857ca7ee49e84381f97aeed43e0faa64b2a18a226b91ceb |