This is a small addition to the previous article about the debuggers.
If you don't know what are you looking for, just use a visualization tool! *
There's so much advice to just roll out your own visualization tool, be it text using the Stats from stdlib or graphical using libraries like pycallgraph or gprof2dot the first reaction would be to actually start writing code to generate reports.
But this is a bad idea, you need to change that code to skew or drill down in the report and generally everything will be confusing if you're not looking for something specific. You will probably overlook that thing that is killing your performance.
You can install it with pip install RunSnakeRun or apt-get install runsnakerun or from sources.
RunSnakeRun is a well rounded tool, easy to integrate - you can just use it with the stdlib cProfile/profile, just specify the filename argument to profile.run, eg:
import cProfile cProfile.run("main()", filename="my.profile")
After that, run this in the shell:
runsnake my.profile ::...
当前网页内容, 由 大妈 ZoomQuiet 使用工具: ScrapBook :: Firefox Extension 人工从互联网中收集并分享;
订阅 substack 体验古早写作:
点击注册~> 获得 100$ 体验券:
关于 ~ DebugUself with DAMA ;-)
公安备案号: 44049002000656 ...::