BenchCraft ⚡
A lightweight, precision Python decorator library for benchmarking execution time and tracking peak memory allocation.
Features
- ⏱️ Execution Time Tracking: High-precision time measurements via
time.perf_counter(). - 🧠 Memory Profiling: Real-time peak memory usage tracking using
tracemalloc. - 📐 Auto-formatting: Human-readable memory unit conversion (
B,KB,MB). - 🛡️ Exception Safe: Guaranteed metrics delivery even if decorated functions raise runtime errors (
try...finally).
Installation
Install locally in editable mode for development:
pip install -e .
Quick Start
import time
from benchcraft import BenchCraft
@BenchCraft(unit="ms")
def heavy_computation():
data = [i for i in range(1000000)]
time.sleep(0.05)
return sum(data)
if __name__ == "__main__":
heavy_computation()
Output
[heavy_computation] Run Time: 85.124000 ms | Peak Memory: 38.15 MB
Metadata
Release files for benchcraftPy 0.1.0
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 |
|---|---|---|---|---|
| benchcraftpy-0.1.0.tar.gz | 3.7 kB | Without provenance | Details for benchcraftpy-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| benchcraftpy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for benchcraftpy-0.1.0-py3-none-any.whl |
Total release size: 7.6 kB
Release files / benchcraftpy-0.1.0.tar.gz
| Download URL | benchcraftpy-0.1.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c013c3c5dc903facf4b2493a5d095a6e49480cfdb4345c4e2011389bdc5eb591
|
|
BLAKE2b-256 checksum How to use checksums |
efb9803667be0d57324e3c6eec61a0fef7119943d1b2d080a5f2e4525599108a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / benchcraftpy-0.1.0-py3-none-any.whl
| Download URL | benchcraftpy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90fdcaa7ef142275f2f903478df7c5c8342cc8ebd456d24a199bc74a61c47754
|
|
BLAKE2b-256 checksum How to use checksums |
5093f6a2bd440f2ef8f0f493b2d84b819d1b7d455909d73ab8c1ee52c3594cba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Security for benchcraftPy 0.1.0
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.