Rails 3.0.0.rc 分析:数千个 Regexp#===(d1) 调用
我在 Rails 应用程序的首页上得到了 0.5 reqs/s(一个非常简单的、大部分是静态的页面,进行了几次数据库调用,但 WEBrick 所说的时间没有超过 0.8 毫秒),使用 Thin.我按照 Dan Mange 博客上的说明将 ruby-prof 分析工具添加到我的 ApplicationController 中,并将调用图转储到标准输出。
这是图表的一小部分: http://pastie.org/1063281
这看起来很荒谬,但谷歌搜索“Regexp#===”没有发现任何有趣的东西。
有人见过这样的事情吗?更好的是,知道如何解决它吗?
这是我的 Gemfile:
gem 'rails', '3.0.0.rc'
gem 'thin'
gem 'capistrano'
gem 'nokogiri'
gem 'pg'
gem 'authlogic', :git => 'git://github.com/binarylogic/authlogic.git'
gem 'paperclip'
gem 'bundler'
gem 'ruby-prof'
gem 'daemons'
I was getting 0.5 reqs/s on the front page of my rails app (a very simple, mostly static page that made a couple of database calls, but nothing that WEBrick said took longer than 0.8 ms), served with thin. I added ruby-prof profiling tools to my ApplicationController via the instructions at Dan Mange's blog and dumped the call graph to standard out.
Here's a little bit of the graph: http://pastie.org/1063281
It seems absurd, but googling for "Regexp#===" finds nothing interesting.
Anyone seen anything like this? Better yet, know how to fix it?
Here's my Gemfile:
gem 'rails', '3.0.0.rc'
gem 'thin'
gem 'capistrano'
gem 'nokogiri'
gem 'pg'
gem 'authlogic', :git => 'git://github.com/binarylogic/authlogic.git'
gem 'paperclip'
gem 'bundler'
gem 'ruby-prof'
gem 'daemons'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议尝试一些其他 ruby-prof 输出。如果你从 github 上获取它,就会发现最近添加了一些(但尚未发布)。
http://github.com/rdp/ruby-prof
I'd recommend trying some of the other ruby-prof outputs. If you grab it from github there have been a few added recently (but not yet released).
http://github.com/rdp/ruby-prof