Tinybench 
Tinybench is a lightweight package to time, compare, and visualize various functions. This package was inspired by the R package microbenchmark
Installation
pip install tinybench
Usage
from tinybench import benchmark, benchmark_env
# create two functions example functions to test
def foo(a):
test = []
for i in range(a):
test.append(i)
return test
def bar(a, b):
return a + b
# example input variable
c = 10000
iterations = 100
warmup = 10
# env should be globals(), or use benchmark_env(functions_list)
# functions_list should at least contain all the functions to benchmark
env = benchmark_env([foo, bar])
# instead, using globals() is recommended
env = globals()
b = benchmark(['Foo_Label:foo(c)', 'bar(10, 15)'], iterations, warmup, env)
print(b)
b.plot()
# alternatively, we can benchmark using the process time instead of real time:
b_process = benchmark(['Foo_Label:foo(c)', 'bar(10, 15)'], iterations, warmup, env, process_time = True)
Support
For any help or questions, please open an issue on GitHub.
License
Metadata
Release files for tinybench 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tinybench-1.0.2.tar.gz | 4.3 kB | Without provenance | Details for tinybench-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tinybench-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for tinybench-1.0.2-py3-none-any.whl |
Total release size: 10.3 kB
Release files / tinybench-1.0.2.tar.gz
| Download URL | tinybench-1.0.2.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
571dda3a0379fc4cfad78c332ad5cb88404cdf6af4089d3f49620dfcfc33b5e4
|
|
BLAKE2b-256 checksum How to use checksums |
1c18952991d71218b207457f77c51760fd6a9370011d08565ab92ae9ef50fa66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4
|
Release files / tinybench-1.0.2-py3-none-any.whl
| Download URL | tinybench-1.0.2-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf91379c00947a8086e2ec2c120bbff254d9213fc295c36bf236dc985bc7487e
|
|
BLAKE2b-256 checksum How to use checksums |
7bbc42298690afcb66eed70ed0d07024c8dc55c7ef2100c1a43035adf0033d52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4
|
Security for tinybench 1.0.2
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.