Profiling
July 21, 2022 ยท View on GitHub
Profiling should be carried out whenever significant changes are made to the pipeline. Profiling results are saved as .txt and .prof files.
Scripts
Profile SimSwap - profile_simswap.py
This script profiles SimSwap pipeline on a single image pair.
Basic Usage
python profile_simswap.py
Visualisation Tools
Apart from analysing the .txt profiling data, we visualise and explore the .prof profiling data with:
- snakeviz: https://jiffyclub.github.io/snakeviz/
- gprof2dot: https://github.com/jrfonseca/gprof2dot
- flameprof: https://github.com/baverman/flameprof
SnakeViz
Conda Installation
conda install -c conda-forge snakeviz
Basic Usage
snakeviz <path/to/profiling_data>.prof --server
GProf2Dot
Conda Installation
conda install graphviz
conda install -c conda-forge gprof2dot
Basic Usage
python -m gprof2dot -f pstats <path/to/profiling_data>.prof | dot -Tpng -o <path/to/profiling_data>.png
FlameProf
Pip Installation
pip install flameprof
Basic Usage
python -m flameprof <path/to/profiling_data>.prof > <path/to/profiling_data>.svg