第一代碼:導軌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