【发布时间】:2010-12-26 03:29:31
【问题描述】:
我正在使用 cProfile 来分析我的 Python 程序。基于this talk,我的印象是KCacheGrind 可以解析并显示cProfile 的输出。
但是,当我去导入文件时,KCacheGrind 只是在状态栏中显示“未知文件格式”错误,并且什么也不显示。
在我的分析统计数据与 KCacheGrind 兼容之前,我需要做些什么特别的事情吗?
...
if profile:
import cProfile
profileFileName = 'Profiles/pythonray_' + time.strftime('%Y%m%d_%H%M%S') + '.profile'
profile = cProfile.Profile()
profile.run('pilImage = camera.render(scene, samplePattern)')
profile.dump_stats(profileFileName)
profile.print_stats()
else:
pilImage = camera.render(scene, samplePattern)
...
软件包版本
- KCacheGrind 4.3.1
- Python 2.6.2
【问题讨论】:
-
只是好奇,谁能指点我这里链接的谈话?好像坏了。
标签: python profiling kcachegrind cprofile