第一代码:导轨3减缓局部渲染
# matches/index.html.haml
%ul.match_list
- @matches.each do |match|
%li
=render match
# matches/_match.html.haml
%li
=match.id
Completed 200 OK in 665ms (Views: 496.3ms | ActiveRecord: 142.1ms)
缓慢的地狱。
二码:
# matches/index.html.haml
%ul.match_list
- @matches.each do |match|
%li
=match.id
Completed 200 OK in 196ms (Views: 30.0ms | ActiveRecord: 134.6ms)
好多了。
为什么在不使用偏色时会快得多?
对不起,我第一次发表评论时看不到结果。 – sosborn 2011-03-26 13:03:09
开发或生产模式? – 2011-03-26 13:20:36
它的开发模式,在生产模式下运行的产品 – methyl 2011-03-26 13:56:22