我正在运行railscasts网站的本地副本以熟悉rails 3.我在点击后查看了开发日志,这就是我所看到的:
Started GET "/" for 127.0.0.1 at 2010-12-16 14:17:07 -0500
Processing by EpisodesController#index as HTML
Episode Load (0.5ms) SELECT "episodes".* FROM "episodes" WHERE (published_at <= '2010-12-16 19:17:07.872204') ORDER BY position DESC LIMIT 10 OFFSET 0
Rendered shared/_navigation.html.erb (1.4ms)
Sponsor Load (0.2ms) SELECT "sponsors".* FROM "sponsors" WHERE (active = 't')
Tag Load (0.1ms) SELECT "tags".* FROM "tags" ORDER BY name
Rendered shared/_side.html.erb (4.2ms)
Rendered episodes/index.html.erb within layouts/application (9.8ms)
Completed 200 OK in 117ms (Views: 12.7ms | ActiveRecord: 0.8ms | Sphinx: 0.0ms)
其余的响应时间来自哪里?它表示完整请求的117毫秒,看起来它正在记录所有数据库查询。剩下的时间真的只是控制器逻辑吗?
答案 0 :(得分:3)
问题很简单。这是一个开发日志片段,所以所有这些额外的时间都被重新加载类的rails吞噬了。
答案 1 :(得分:1)
剩下的时间会转到: