Profiling should be carried out whenever significant changes are made to the pipeline. Profiling results are saved as .txt
and .prof
files.
This script profiles SimSwap pipeline on a single image pair.
python profile_simswap.py
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
conda install -c conda-forge snakeviz
snakeviz <path/to/profiling_data>.prof --server
conda install graphviz
conda install -c conda-forge gprof2dot
python -m gprof2dot -f pstats <path/to/profiling_data>.prof | dot -Tpng -o <path/to/profiling_data>.png
pip install flameprof
python -m flameprof <path/to/profiling_data>.prof > <path/to/profiling_data>.svg