aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/examples/views/_hundred_partials.erb
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-08-10 02:54:17 -0400
committerYehuda Katz <wycats@gmail.com>2009-08-11 15:03:53 -0700
commit4945d8223964d4ccb3c0a0f4107f15ae1c6c4a09 (patch)
treee283f8192ea7d4563926b91e5a430e3462999090 /actionpack/examples/views/_hundred_partials.erb
parentbef7576c09bbd51aeeb8e83b4cf24a994a0256b0 (diff)
downloadrails-4945d8223964d4ccb3c0a0f4107f15ae1c6c4a09.tar.gz
rails-4945d8223964d4ccb3c0a0f4107f15ae1c6c4a09.tar.bz2
rails-4945d8223964d4ccb3c0a0f4107f15ae1c6c4a09.zip
Further experimentation. Was able to cut the cost of rendering 100 partials in a collection in half.
To discuss: What are the desired semantics (if any) for layouts in a collection. There are no tests for it at present, and I'm not sure if it's needed at all. Deprecated on this branch: `object` pointing at the current object in partials. You can still use the partial name, or use :as to achieve the same thing. This is obviously up for discussion.
Diffstat (limited to 'actionpack/examples/views/_hundred_partials.erb')
-rw-r--r--actionpack/examples/views/_hundred_partials.erb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/examples/views/_hundred_partials.erb b/actionpack/examples/views/_hundred_partials.erb
new file mode 100644
index 0000000000..15e99c1b68
--- /dev/null
+++ b/actionpack/examples/views/_hundred_partials.erb
@@ -0,0 +1,12 @@
+<% 10.times do %>
+ <%= render :partial => '/hello' %>
+ <%= render :partial => '/hello' %>
+ <%= render :partial => '/hello' %>
+ <%= render :partial => '/hello' %>
+ <%= render :partial => '/hello' %>
+ <%= render :partial => '/hello' %>
+ <%= render :partial => '/hello' %>
+ <%= render :partial => '/hello' %>
+ <%= render :partial => '/hello' %>
+ <%= render :partial => '/hello' %>
+<% end %> \ No newline at end of file