An open API service indexing awesome lists of open source software.

https://github.com/mirecl/pprof

Python profiling tool
https://github.com/mirecl/pprof

perfomance profiling profiling-library pypi python python3

Last synced: about 1 year ago
JSON representation

Python profiling tool

Awesome Lists containing this project

README

          


pprof



PyPi


PePy


Black


License


Test


Test




PyPi


OS

---

## Installing

```sh
pip install pprof
```

or

```sh
poetry add pprof
```

## A Simple Example

```python
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)))
```

```sh
(venv) python run.py
```

## Links

+ **line_profiler** ()