分析 Python 脚本的推荐流程
假设我们要分析 myscript.py,运行:
profile_commands.sh
python3 -m cProfile -o myscript.profile myscript.py为了查看它,我强烈推荐 runsnakerun:
runsnake_view_profile.sh
runsnake myscript.profile你可以在 Ubuntu 上使用以下命令安装 runsnake
install_runsnakerun.sh
sudo apt -y install runsnakerunCheck out similar posts by category:
Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow