到目前为止,我发现的最佳匹配是从命令行使用 ruby-prof 并尝试猜测从那里读取的图形。
require 'ruby-prof'
# Profile the code
RubyProf.start
...
[code to profile]
...
result = RubyProf.stop
# Print a flat profile to text
printer = RubyProf::FlatPrinter.new(result)
printer.print(STDOUT)
https://github.com/rdp/ruby-prof
这种方法的主要问题是你必须修改你的代码才能看到分析并且不是很可读。
我也尝试过一些 IDE:RubyMine、Aptana 和 Netbeans,但没有人有适当的图形界面来分析代码。
有什么推荐吗?