Kcachegrind是一个出色的实用程序,可以在分析代码时将热点直观地表示到源代码行级别。我发现它在微优化我的 C++ 代码库时非常有用。对于我最新的 python 项目,我开始使用 Kcachegrind 来处理profilestats的输出。Kcachegrind是一个仅限 linux 的实用程序,但有各种非官方端口可用,我正在使用的一个是qcachegrind。一般来说,它在很大程度上可以解决大多数问题,除了我很难让源注释工作。
在源选项卡上,我收到了熟悉的源缺失消息
There is no source available for the following function:
'main C:\Projects\module\src\source.py:397'
This is because no debug information is present
Recompile source and redo the profile run.
The function is located in the ELF Object:
'(unknown)'
使用选项
Settings -> Configure -> Source Annotation
并且添加源基本目录没有用。
我有一种感觉,该实用程序需要一个与 Python 无关的 ELF 对象。在这方面的任何帮助都会很有用。
相关信息:
- 蟒蛇 2.7
- 个人资料统计 (2.0)
- QCachegrind 0.7.4
- 视窗 2012R2