... | ... | @@ -6,15 +6,29 @@ |
|
|
|
|
|
### With cProfile
|
|
|
|
|
|
Collect data:
|
|
|
|
|
|
```sh
|
|
|
pip install pyprof2calltree
|
|
|
apt install qcachegrind
|
|
|
python -m cProfile -o out.cprof script.py args...
|
|
|
```
|
|
|
|
|
|
Use [snakeviz](https://jiffyclub.github.io/snakeviz/) to visualize collected data:
|
|
|
|
|
|
```sh
|
|
|
python -m cProfile -o out.cprof script.py args...
|
|
|
pip install snakeviz
|
|
|
|
|
|
snakeviz out.cprof
|
|
|
```
|
|
|
|
|
|
Alternatives to snakeviz:
|
|
|
|
|
|
```sh
|
|
|
pip install pyprof2calltree
|
|
|
apt install qcachegrind
|
|
|
|
|
|
pyprof2calltree -k -i out.cprof
|
|
|
```
|
|
|
|
|
|
### With pprofile
|
|
|
|
|
|
https://github.com/vpelletier/pprofile
|
... | ... | |