一個交互式的Python分析器:Profiling

jopen 10年前發布 | 17K 次閱讀 Profiling Python開發

該分析包是一個交互式的Python分析器。它受Unity 3D分析器啟發。這個包提供了以下功能:

  1. 剖析統計數據保持架堆棧。
  2. 一個交互式TUI分析統計查看器。
  3. 進行遠程分析的工具。
  4. 線程或greenlet感知的CPU定時器。
  5. 支持的Python2和Python3。
  6. </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:

    your-program.png

    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

    項目主頁:http://www.baiduhome.net/lib/view/home/1412127708390

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!