到目前为止,我发现的最佳匹配是从命令行使用 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,但没有人拥有合适的图形界面来分析代码。
有什么推荐吗?
最佳答案
尝试 ruby-prof 命令行工具: http://ruby-prof.rubyforge.org/files/bin/ruby-prof.html
并使用如下所示的内容:
ruby-prof -p graph_html -f filename.html rubycode.rb
关于ruby-on-rails - 哪个是最好的图形化 Ruby 分析器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8448705/