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

jopen 11年前

该分析包是一个交互式的Python分析器。它受Unity 3D分析器启发。这个包提供了以下功能:

  1. 剖析统计数据保持架堆栈。
  2. 一个交互式TUI分析统计查看器。
  3. 进行远程分析的工具。
  4. 线程或greenlet感知的CPU定时器。
  5. 支持的Python2和Python3。

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.open-open.com/lib/view/home/1412127708390