Python profiling tool
Project description
Installing
pip install pprof
or
poetry add pprof
A Simple Example
from time import sleep
from typing import List
from pprof import cpu
cpu.auto_report()
def foo():
sleep(1.01)
return 3
@cpu
def run(arr: List) -> float:
tmp = []
cnt = foo()
# comment action #1
for row in arr:
# comment action #2 row 1
# comment action #2 row 2
if row % cnt == 0:
tmp.append(row)
result = (sum(tmp * 200) + len(arr)) / len(tmp) # comment action #3
return result
run(list(range(250000)))
(venv) python run.py
Links
- line_profiler (https://github.com/pyutils/line_profiler)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pprof-0.2.0.tar.gz
(4.5 kB
view details)
Built Distribution
pprof-0.2.0-py3-none-any.whl
(4.2 kB
view details)
File details
Details for the file pprof-0.2.0.tar.gz
.
File metadata
- Download URL: pprof-0.2.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.6.15 Linux/5.13.0-1017-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd34007e8f192e6829e8953ad7b9aa2311d37fd9625703d15ff2934a7af3151c |
|
MD5 | 38d01e12abe1259f5f8e718a1042159b |
|
BLAKE2b-256 | e1f6cab19cdb4ecbb2a386f98166f81ea5c5ca68e1b0196c1876c67a414532bc |
File details
Details for the file pprof-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pprof-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.6.15 Linux/5.13.0-1017-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f93c22c7fae319a52ec971360ce9402fa91fe21dfddf3e4e67c39ec4574f274 |
|
MD5 | f1662a3fc0909282faf5e42cfe7ca774 |
|
BLAKE2b-256 | 064fb9d7c206d88231b0cd43a7110738af19fcef7c86203216bdfb4ef7cf76c5 |