diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-08-10 02:54:17 -0400 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-08-11 15:03:53 -0700 |
commit | 4945d8223964d4ccb3c0a0f4107f15ae1c6c4a09 (patch) | |
tree | e283f8192ea7d4563926b91e5a430e3462999090 /actionpack/examples | |
parent | bef7576c09bbd51aeeb8e83b4cf24a994a0256b0 (diff) | |
download | rails-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')
-rw-r--r-- | actionpack/examples/minimal.rb | 4 | ||||
-rw-r--r-- | actionpack/examples/views/_hundred_partials.erb | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/actionpack/examples/minimal.rb b/actionpack/examples/minimal.rb index c4e5ffd36e..90435d0b89 100644 --- a/actionpack/examples/minimal.rb +++ b/actionpack/examples/minimal.rb @@ -104,22 +104,22 @@ ActionController::Base.use_accept_header = false unless ENV["PROFILE"] Runner.run(BasePostController.action(:overhead), N, 'overhead', false) Runner.run(BasePostController.action(:index), N, 'index', false) + Runner.run(BasePostController.action(:show_template), N, 'template', false) Runner.run(BasePostController.action(:partial), N, 'partial', false) Runner.run(BasePostController.action(:many_partials), N, 'many_partials', false) Runner.run(BasePostController.action(:partial_collection), N, 'collection', false) Runner.run(BasePostController.action(:hundred_partials), N, 'hundred_partials', false) Runner.run(BasePostController.action(:large_collection), N, 'large_collection', false) - Runner.run(BasePostController.action(:show_template), N, 'template', false) (ENV["M"] || 1).to_i.times do Runner.run(BasePostController.action(:overhead), N, 'overhead') Runner.run(BasePostController.action(:index), N, 'index') + Runner.run(BasePostController.action(:show_template), N, 'template') Runner.run(BasePostController.action(:partial), N, 'partial') Runner.run(BasePostController.action(:many_partials), N, 'many_partials') Runner.run(BasePostController.action(:partial_collection), N, 'collection') Runner.run(BasePostController.action(:hundred_partials), N, 'hundred_partials') Runner.run(BasePostController.action(:large_collection), N, 'large_collection') - Runner.run(BasePostController.action(:show_template), N, 'template') end else Runner.run(BasePostController.action(ENV["PROFILE"].to_sym), N, ENV["PROFILE"]) 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 |