是否有适用于 Python 的可视化分析器? [英] Is there a visual profiler for Python?

查看:52
本文介绍了是否有适用于 Python 的可视化分析器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在使用 cProfile 但我发现编写 pstats 代码只是为了查询很乏味统计数据.

我正在寻找一种可视化工具,它可以向我展示我的 Python 代码在 CPU 时间和内存分配方面的作用.

Java 世界中的一些示例是 visualvmJProfiler.

  • 是否存在类似的东西?
  • 是否有可以执行此操作的 IDE?
  • dtrace 帮助?

我知道 KCachegrind 适用于 Linux,但我更喜欢我能做的无需安装 KDE 即可在 Windows/Mac 上运行.

解决方案

我和一个朋友编写了一个 Python 配置文件查看器,名为 SnakeViz 在网络浏览器中运行.如果您已经成功使用 RunSnakeRun SnakeViz 可能不会增加那么多价值,但 SnakeViz 安装起来要容易得多.>

SnakeViz 支持 Python 2 和 3 并适用于所有主要系统.

I use cProfile now but I find it tedious to write pstats code just to query the statistics data.

I'm looking for a visual tool that shows me what my Python code is doing in terms of CPU time and memory allocation.

Some examples from the Java world are visualvm and JProfiler.

  • Does something like this exist?
  • Is there an IDE that does this?
  • Would dtrace help?

I know about KCachegrind for Linux, but I would prefer something that I can run on Windows/Mac without installing KDE.

解决方案

A friend and I have written a Python profile viewer called SnakeViz that runs in a web browser. If you are already successfully using RunSnakeRun SnakeViz may not add that much value, but SnakeViz is much easier to install.

Edit: SnakeViz supports Python 2 and 3 and works on all major systems.

这篇关于是否有适用于 Python 的可视化分析器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆