diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-09 17:55:26 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-09 17:55:26 +0000 |
commit | 955fa6151aabfbe0626c84005cb0cad27da3e5c3 (patch) | |
tree | 8d9175f86572bbf00f5e3f021e7b6c7b3804e3f2 /actionpack/examples/benchmark.rb | |
parent | 73c70836515879f69a152535f3ab411acc3317b8 (diff) | |
download | rails-955fa6151aabfbe0626c84005cb0cad27da3e5c3.tar.gz rails-955fa6151aabfbe0626c84005cb0cad27da3e5c3.tar.bz2 rails-955fa6151aabfbe0626c84005cb0cad27da3e5c3.zip |
The examples are outdated and misleading
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7424 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/examples/benchmark.rb')
-rw-r--r-- | actionpack/examples/benchmark.rb | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/actionpack/examples/benchmark.rb b/actionpack/examples/benchmark.rb deleted file mode 100644 index 78a6649c74..0000000000 --- a/actionpack/examples/benchmark.rb +++ /dev/null @@ -1,52 +0,0 @@ -$:.unshift(File.dirname(__FILE__) + "/../lib") - -require "action_controller" -require 'action_controller/test_process' - -Person = Struct.new("Person", :name, :address, :age) - -class BenchmarkController < ActionController::Base - def message - render :text => "hello world" - end - - def list - @people = [ Person.new("David"), Person.new("Mary") ] - render_template "hello: <% for person in @people %>Name: <%= person.name %><% end %>" - end - - def form_helper - @person = Person.new "david", "hyacintvej", 24 - render_template( - "<% person = Person.new 'Mary', 'hyacintvej', 22 %> " + - "change the name <%= text_field 'person', 'name' %> and <%= text_field 'person', 'address' %> and <%= text_field 'person', 'age' %>" - ) - end -end - -#ActionController::Base.view_paths = [ File.dirname(__FILE__) ] - -require "benchmark" - -RUNS = ARGV[0] ? ARGV[0].to_i : 50 - -require "profile" if ARGV[1] - -runtime = Benchmark.measure { - RUNS.times { BenchmarkController.process_test(ActionController::TestRequest.new({ "action" => "list" })) } -} - -puts "List: #{RUNS / runtime.real}" - - -runtime = Benchmark.measure { - RUNS.times { BenchmarkController.process_test(ActionController::TestRequest.new({ "action" => "message" })) } -} - -puts "Message: #{RUNS / runtime.real}" - -runtime = Benchmark.measure { - RUNS.times { BenchmarkController.process_test(ActionController::TestRequest.new({ "action" => "form_helper" })) } -} - -puts "Form helper: #{RUNS / runtime.real}" |