在rails中生成视图需要多长时间?

时间:2015-05-19 05:50:08

标签: ruby-on-rails

我正在使用Rails和rails server命令构建应用程序,我看到生成视图需要多长时间。

我从同一页面的输出中收集了一个样本。

Completed 200 OK in 935ms (Views: 934.4ms | ActiveRecord: 0.0ms)
Completed 200 OK in 1093ms (Views: 1093.3ms | ActiveRecord: 0.0ms)
Completed 200 OK in 907ms (Views: 907.0ms | ActiveRecord: 0.0ms)
Completed 200 OK in 970ms (Views: 969.9ms | ActiveRecord: 0.0ms)
Completed 200 OK in 901ms (Views: 900.8ms | ActiveRecord: 0.0ms)
Completed 200 OK in 1003ms (Views: 1002.7ms | ActiveRecord: 0.0ms)
Completed 200 OK in 1069ms (Views: 1069.0ms | ActiveRecord: 0.0ms)
Completed 200 OK in 991ms (Views: 991.1ms | ActiveRecord: 0.0ms)
Completed 200 OK in 933ms (Views: 933.1ms | ActiveRecord: 0.0ms)
Completed 200 OK in 933ms (Views: 932.9ms | ActiveRecord: 0.0ms)
Completed 200 OK in 55ms (Views: 54.5ms | ActiveRecord: 0.0ms)
Completed 200 OK in 993ms (Views: 992.4ms | ActiveRecord: 0.0ms)
Completed 200 OK in 1077ms (Views: 1076.6ms | ActiveRecord: 0.0ms)
Completed 200 OK in 52ms (Views: 52.2ms | ActiveRecord: 0.0ms)
Completed 200 OK in 54ms (Views: 54.0ms | ActiveRecord: 0.0ms)
Completed 200 OK in 988ms (Views: 988.1ms | ActiveRecord: 0.0ms)
Completed 200 OK in 908ms (Views: 907.7ms | ActiveRecord: 0.0ms)
Completed 200 OK in 899ms (Views: 899.2ms | ActiveRecord: 0.0ms)
Completed 200 OK in 872ms (Views: 871.7ms | ActiveRecord: 0.0ms)
Completed 200 OK in 55ms (Views: 54.4ms | ActiveRecord: 0.0ms)
Completed 200 OK in 59ms (Views: 59.2ms | ActiveRecord: 0.0ms)
Completed 200 OK in 56ms (Views: 55.4ms | ActiveRecord: 0.0ms)
Completed 200 OK in 58ms (Views: 57.6ms | ActiveRecord: 0.0ms)
Completed 200 OK in 1178ms (Views: 1178.3ms | ActiveRecord: 0.0ms)
Completed 200 OK in 998ms (Views: 998.3ms | ActiveRecord: 0.0ms)
Completed 200 OK in 116ms (Views: 116.2ms | ActiveRecord: 0.0ms)
Completed 200 OK in 35ms (Views: 34.5ms | ActiveRecord: 0.0ms)
Completed 200 OK in 34ms (Views: 33.8ms | ActiveRecord: 0.0ms)
Completed 200 OK in 30ms (Views: 29.8ms | ActiveRecord: 0.0ms)
Completed 200 OK in 23ms (Views: 23.0ms | ActiveRecord: 0.0ms)
Completed 200 OK in 22ms (Views: 22.3ms | ActiveRecord: 0.0ms)
Completed 200 OK in 56ms (Views: 55.7ms | ActiveRecord: 0.0ms)
Completed 200 OK in 55ms (Views: 54.7ms | ActiveRecord: 0.0ms)
Completed 200 OK in 996ms (Views: 996.0ms | ActiveRecord: 0.0ms)
Completed 200 OK in 1091ms (Views: 1091.1ms | ActiveRecord: 0.0ms)
Completed 200 OK in 75ms (Views: 75.2ms | ActiveRecord: 0.0ms)
Completed 200 OK in 68ms (Views: 68.0ms | ActiveRecord: 0.0ms)
Completed 200 OK in 69ms (Views: 68.5ms | ActiveRecord: 0.0ms)
Completed 200 OK in 127ms (Views: 126.8ms | ActiveRecord: 0.0ms)
Completed 200 OK in 940ms (Views: 939.8ms | ActiveRecord: 0.0ms)
Completed 200 OK in 34ms (Views: 33.9ms | ActiveRecord: 0.0ms)
Completed 200 OK in 982ms (Views: 981.7ms | ActiveRecord: 0.0ms)
Completed 200 OK in 930ms (Views: 929.8ms | ActiveRecord: 0.0ms)
Completed 200 OK in 74ms (Views: 73.9ms | ActiveRecord: 0.0ms)
Completed 200 OK in 1075ms (Views: 1075.4ms | ActiveRecord: 0.0ms)
Completed 200 OK in 35ms (Views: 34.8ms | ActiveRecord: 0.0ms)
Completed 200 OK in 121ms (Views: 120.6ms | ActiveRecord: 0.0ms)
Completed 200 OK in 35ms (Views: 35.3ms | ActiveRecord: 0.0ms)

请注意,请求来自同一页面。它的范围从35ms到1000ms。查看详细信息,我只看到它如何呈现部分

  Rendered svgs/_logo_typeface_blue_small.html (0.0ms)
  Rendered shared/_header_nav.html.slim (1.0ms)
  Rendered templates/_calendar.html (0.0ms)
  Rendered pages/item.html.slim within layouts/application (10.4ms)
  Rendered shared/_flash.html.slim (0.1ms)

这不应该导致900ms视图生成时间。我想知道如何能够更多地了解导致1000ms视图生成的原因

0 个答案:

没有答案