Skip to main content

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


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)

Uploaded Source

Built Distributions

py_perf_event-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

py_perf_event-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

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

Hashes for py_perf_event-0.1.0.tar.gz
Algorithm Hash digest
SHA256 98eb387c32e290e08bcc93153881b5cbadb2bf6b305c8812d4bc0204ce859ad6
MD5 3ed69a896ce2371bd1d866a15b38401c
BLAKE2b-256 e2bc1b6557b555be2ca73a3bbb052ff1ead8b08cf6d7ecbdacca88fa933529fc

See more details on using hashes here.

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

File hashes

Hashes for py_perf_event-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 72f9f4ce7c10f8a488f0a672b326bcbb3c53364c5ea2b6a2606f1535dc9fa1fc
MD5 174816990d554f76d2d79a8d015c4fec
BLAKE2b-256 97ac437f8c3046850d97b7ba5015abf05be1ec40f59156932c072e6fb10e80ca

See more details on using hashes here.

File details

Details for the file py_perf_event-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for py_perf_event-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6969c9acbb030045dd4a5119d8767518e2a011bba1d5355df5a490200d29430e
MD5 383e59507d8ffd7523e42755719d337b
BLAKE2b-256 412a207a263cd9f55857ca7ee49e84381f97aeed43e0faa64b2a18a226b91ceb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page