Wrapper script for easier use of the built-in profiler
Project description
Python3 - Profiler Wrapper
This package provides a wrapper function for easier usage of the built-in profiler.
It only uses builtin modules.
Install
python3 -m pip install profiler-wrapper
See: PyPI
Usage
from profiler_wrapper import profile
def function_to_profile(switch: bool, data: dict, msg: str):
...
return {'data': 'test'}
profile(
target=function_to_profile,
args=[True],
kwargs={
'data': {'random': 'test'},
'msg': 'Yesterday is gone.'
},
lines=3,
)
# (
# {'data': 'test'},
#
# "270011472 function calls (270011215 primitive calls) in 181.830 seconds
# Ordered by: internal time
#
# ncalls tottime percall cumtime percall filename:lineno(function)
# 1 5.000 5.000 8.000 8.000 /tmp/test.py:95(function_to_profile)
# 2 2.000 2.000 3.000 3.000 /tmp/test.py:89(sub_function)
# 3 1.000 1.000 1.000 1.000 /tmp/test.py:89(sub_function2)
# "
# )
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
profiler_wrapper-1.0.1.tar.gz
(13.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file profiler_wrapper-1.0.1.tar.gz.
File metadata
- Download URL: profiler_wrapper-1.0.1.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8904818e8e3abb46138b4cc079f73737640a208d924e52a0749810a0e34a0742
|
|
| MD5 |
77833d52c9e4029ab6f7db75b33885ae
|
|
| BLAKE2b-256 |
6e8d9c19bfd059db248727b82f1d5c7a04f2f4f24d9baa22f4cf9717615957e4
|
File details
Details for the file profiler_wrapper-1.0.1-py3-none-any.whl.
File metadata
- Download URL: profiler_wrapper-1.0.1-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f7431f56ba512ce5f37272a2c652db2c5a6b23758de2111f04f1b821447e2e6
|
|
| MD5 |
ba05c15d076086feb245c71137305e0e
|
|
| BLAKE2b-256 |
509e18aa5383f0cc45034d90d34b9d61a5dae56ffbb3a07aa453543086673bcc
|