Skip to main content

ptime

A tool for measuring serial and parallel execution, and comparing the results. Provides an IPython magic %ptime. This can be useful for measuring the benefits of parallelizing code, including measuring the effect of the Global Interpreter Lock (GIL).

Example

In [1]: %load_ext ptime

In [2]: import numpy as np

In [3]: x = np.ones((5000, 10000))

In [4]: %ptime x + x
Total serial time:   0.42 s
Total parallel time: 0.25 s
For a 1.67X speedup across 2 threads

In [5]: %ptime -n4 x + x  # use 4 threads
Total serial time:   0.82 s
Total parallel time: 0.31 s
For a 2.60X speedup across 4 threads

In [6]: res = %ptime -o x + x  # Get the result
Total serial time:   0.41 s
Total parallel time: 0.25 s
For a 1.66X speedup across 2 threads

In [7]: res.speedup
Out[7]: 1.6610825669011922

In [8]: %%ptime  # Use as a cell magic
...: x = np.ones((5000, 10000))
...: y = x + x
...:
Total serial time:   0.72 s
Total parallel time: 0.47 s
For a 1.54X speedup across 2 threads

Install

This package is available via pip:

pip install ptime

Metadata

Release files for ptime 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ptime 0.0.1
File Size Uploaded Provenance Actions
ptime-0.0.1.tar.gz 2.8 kB Without provenance Details for ptime-0.0.1.tar.gz

Release files / ptime-0.0.1.tar.gz

Download URL ptime-0.0.1.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
753fe7862bf081bb61391c59aa41e159a8e77bc5a7b091bf7e137c4f90739e6d
BLAKE2b-256 checksum
How to use checksums
0ba9f7bce9926eac778faa994cff43eb91816f83a3db40104922dbccb38503da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ptime 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page