pprof

PyPI Downloads Code Style GitHub Tests codecov

Installing

pip install pprof

or

poetry add pprof

A Simple Example

from typing import List
from pprof import cpu

cpu.auto_report()

@cpu
def run(arr: List) -> float:
    tmp = []
    for row in arr:
        if row % 3 == 0:
            tmp.append(row)
    result = (sum(tmp*100) + len(arr)) / len(tmp)
    return result

run(list(range(100000)))
(venv) python run.py

Links

GitHub

View Github