diff --git a/Programming-Languages/Python/Performance Analysis.md b/Programming-Languages/Python/Performance Analysis.md new file mode 100644 index 000000000..9bbad0355 --- /dev/null +++ b/Programming-Languages/Python/Performance Analysis.md @@ -0,0 +1,18 @@ +# Profiler + +```bash +python3 -m cProfile -o log.pstats -m my_module +``` + +## Visualisation + +### gprof2dot (Dot Diagram) + +```bash +sudo pacman -S graphviz +pip3 install gprof2dot +``` + +```bash +gprof2dot -f pstats log.pstats | dot -Tsvg -o log.svg +```