1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add a few more benches

This commit is contained in:
Yehuda Katz 2009-08-09 09:59:54 -03:00
parent 02d9dd9000
commit bef7576c09

View file

@ -73,10 +73,18 @@ class BasePostController < ActionController::Base
render :partial => "/many_partials" render :partial => "/many_partials"
end end
def hundred_partials
render :partial => "/hundred_partials"
end
def partial_collection def partial_collection
render :partial => "/collection", :collection => [1,2,3,4,5,6,7,8,9,10] render :partial => "/collection", :collection => [1,2,3,4,5,6,7,8,9,10]
end end
def large_collection
render :partial => "/collection", :collection => (1...100).to_a
end
def show_template def show_template
render :template => "template" render :template => "template"
end end
@ -99,6 +107,8 @@ unless ENV["PROFILE"]
Runner.run(BasePostController.action(:partial), N, 'partial', false) Runner.run(BasePostController.action(:partial), N, 'partial', false)
Runner.run(BasePostController.action(:many_partials), N, 'many_partials', false) Runner.run(BasePostController.action(:many_partials), N, 'many_partials', false)
Runner.run(BasePostController.action(:partial_collection), N, 'collection', 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) Runner.run(BasePostController.action(:show_template), N, 'template', false)
(ENV["M"] || 1).to_i.times do (ENV["M"] || 1).to_i.times do
@ -107,6 +117,8 @@ unless ENV["PROFILE"]
Runner.run(BasePostController.action(:partial), N, 'partial') Runner.run(BasePostController.action(:partial), N, 'partial')
Runner.run(BasePostController.action(:many_partials), N, 'many_partials') Runner.run(BasePostController.action(:many_partials), N, 'many_partials')
Runner.run(BasePostController.action(:partial_collection), N, 'collection') 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') Runner.run(BasePostController.action(:show_template), N, 'template')
end end
else else