一個交互式的Python分析器:Profiling
該分析包是一個交互式的Python分析器。它受Unity 3D分析器啟發。這個包提供了以下功能:
- 剖析統計數據保持架堆棧。
- 一個交互式TUI分析統計查看器。
- 進行遠程分析的工具。
- 線程或greenlet感知的CPU定時器。
- 支持的Python2和Python3。 </ol>
Profiling
To profile a single program, simply run profile
command:
$ python -m profiling profile your-program.py
Then an interactive viewer will be executed:
If your program uses greenlets, choose greenlet
timer:
$ python -m profiling profile your-program.py --timer=greenlet
With --dump
option, it saves the profiling result to a file. You can browse the saved result by using the view
command:
$ python -m profiling profile your-program.py --dump=your-program.prf $ python -m profiling view your-program.prf
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!