如何分析 Controller 操作?
我的一个观点需要相当长的时间来渲染,我想把它分解一下。我看到script/performance/profiler
,但这似乎只能访问全局范围。
最佳答案
ruby-prof是要走的路。这是一个方法,How to profile your Rails and Ruby applications with ruby-prof .
如果与kcachegrind等可视化工具结合使用,您可以轻松地将应用程序代码与框架代码分开。
不久前,我在本地的 Ruby 用户组就这些工具进行了演讲:Making your rails app kick ass with ruby-prof and kcachegrind .
关于ruby-on-rails - 如何在 Ruby on Rails 中分析请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2716418/