Python/C性能分析功能说明
使用Python程序及Python和C/C++混合程序时,若存在性能瓶颈可使用该工具分析获取热点函数,快速定位代码问题,提升程序性能。
命令功能
通过ptrace对Python程序及Python和C/C++的混合程序进行采样,分析调用栈信息,获取Top20的热点函数并绘制火焰图。
命令格式
1 | devkit py-perf [-h | --help] TASK [ARGS] |

示例均为RPM包安装使用。
使用示例
执行以下命令,查看Python/C性能分析支持的功能信息:
1 | devkit py-perf -h |
返回信息如下:
1 2 3 4 5 6 7 | Usage: devkit py-perf [-h | --help] TASK [ARGS] The most commonly used devkit py-perf sub tasks are: help Get help information hotspot Run the hotspot collection and analysis task See 'devkit py-perf TASK --help' for more information on a specific task. |
功能 |
说明 |
---|---|
help |
查看帮助信息。 |
hotspot |
Python/C性能的热点分析。 |
父主题: Python/C性能分析