Skip to content

07 Debugging and Profiling

Takeaways

debuggger: reloadware/reloadium: Advanced Hot Reloading & Profiling for Python

online shell scripting checker (use pre-commit hooks instead): ShellCheck – shell script analysis tool

hyperfine for blackbox-benmarking: sharkdp/hyperfine: A command-line benchmarking tool (github.com)

call graphs for code/file structrue: Command-line Usage — Python Call Graph 1.0.1 documentation (slowchop.com)

profile a Python script

# check corresponding manpage for detailed usage e.g. sort by time etc.
python -m cProfile script.py
python -m line_profiler script.py
python -m memory_profiler script.py