A simple profiling decorator:
In [1]: from profiled import profiled, Profiler
In [2]: @profiled
...: def get_answer():
...: return 42
...:
In [3]: profiler = Profiler()
In [4]: with profiler:
...: for i in range(100000): get_answer()
...:
In [5]: profiler.compute_stats()
Out[5]:
{'get_answer': {'avg': 2.2763967514038087e-07,
'max': 0.00016736984252929688,
'min': 0.0,
'num': 100000,
'std': 6.953436521202228e-07,
'tot': 0.022763967514038086}}
The decorator also works with class methods. That’s about it.
Install with pip install profiled.
Metadata
Release files for profiled 2.0.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 | |
|---|---|---|---|
| profiled-2.0.0.tar.gz | 2.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| profiled-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.3 kB
Release files / profiled-2.0.0.tar.gz
| Download URL | profiled-2.0.0.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3bedc516d5f549ea5a8fd2b92287014952b8d6ea38fdf380ab0f0359558efe1c
|
|
BLAKE2b-256 checksum How to use checksums |
77bc07a086c761bbdb70e0f1ffa17db27586c5b81006d2eadc6d4f4169664812
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-39-generic
|
Release files / profiled-2.0.0-py3-none-any.whl
| Download URL | profiled-2.0.0-py3-none-any.whl |
|---|---|
| Size | 2.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8a2c59005c00e65bcc1607b0c06549812f42d7e518f470b4a57fd7e9541b4a2
|
|
BLAKE2b-256 checksum How to use checksums |
d1c1f75418cddcd9913addb625859190cc061011ef3ba58a5f84a1e8a6d6d6e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-39-generic
|