Pre-release
This release is a pre-release and may not be stable for production use.
benchmarkme
Ergonomic Python interface to the built-in timeit utility for quick-look
profiling.
Out-Of-The-Box Features
- Python API with enhanced reporting
- Yields configuration, best & worst times and processing rates
- Default autoranging
- Automatic looping & repeat
- Customizable environment
Usage
Minimal example
>>> from time import sleep
>>> from benchmarkme import BenchMark
>>> b = BenchMark(f=sleep, fargs=[0.2,])
>>> b() # call the instance directly to run the main utility
Benchmark Results
-----------------
* Ran 1 trials 5 times.
* Time of one independent trial: 200 msec
* Best time of subsequent trials: 200 msec
* Worst time of subsequent trials: 200 msec
* Best speed: 5 items / sec
* Worst speed: 4.99 items / sec
Provide the items processed to get rate in the desired units (from
benchmarkme/examples/basic.py)
import math
from benchmarkme import BenchMark
def fmath(x: list) -> None:
"""Calculate somethig complex-looking to time."""
return [math.log(math.acos(item / 1e5)) ** 2 / 1733 for item in x]
items = 100000
bmrk_math = BenchMark(
f=fmath,
fargs=[[*range(items)],],
item_units='numbers',
items_processed=items
)
if __name__ == "__main__":
bmrk_math()
You'll get something like the following, i.e. the function computes around 10 million numbers per second on this machine.
Benchmark Results
-----------------
* Ran 50 trials 5 times.
* Time of one independent trial: 8.92 msec
* Best time of subsequent trials: 8.89 msec
* Worst time of subsequent trials: 12.1 msec
* Best speed: 11.2 Mnumbers / sec
* Worst speed: 8.28 Mnumbers / sec
Release files for benchmarkme 0.1.0a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| benchmarkme-0.1.0a2.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| benchmarkme-0.1.0a2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.9 kB
Release files / benchmarkme-0.1.0a2.tar.gz
| Download URL | benchmarkme-0.1.0a2.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70e8cb574ead239887f378ad0bbd74611453dd8bd27b084ab42f4f08e5ac1edc
|
|
BLAKE2b-256 checksum How to use checksums |
130331b7db979a50866e858ac21f825f71cdc72db4ecdf35079be204c5ec95bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / benchmarkme-0.1.0a2-py3-none-any.whl
| Download URL | benchmarkme-0.1.0a2-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7bc85cd4906798e112335fb1d616453c49c2c2c9f756d653289864a1ce6654e
|
|
BLAKE2b-256 checksum How to use checksums |
13077721fb190119f7e04796d1cd36c94fc9de26e67ee433f92d73783d7c395b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|