diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-24 16:45:39 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-24 16:45:39 +0000 |
commit | 4f40b2d8fbcfb437a628a353eb281553fc840728 (patch) | |
tree | 67e6d5c4ccf2eabe7644e830122f721f747f60fa /actionpack/lib/action_controller/benchmarking.rb | |
parent | 3ccea931fac2872ffb26014592c036b5d137655f (diff) | |
download | rails-4f40b2d8fbcfb437a628a353eb281553fc840728.tar.gz rails-4f40b2d8fbcfb437a628a353eb281553fc840728.tar.bz2 rails-4f40b2d8fbcfb437a628a353eb281553fc840728.zip |
Improved performance of test app req/sec with ~10% refactoring the render method #1823 [Stefan Kaes]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1915 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/benchmarking.rb')
-rw-r--r-- | actionpack/lib/action_controller/benchmarking.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/benchmarking.rb b/actionpack/lib/action_controller/benchmarking.rb index db129f1839..386a291196 100644 --- a/actionpack/lib/action_controller/benchmarking.rb +++ b/actionpack/lib/action_controller/benchmarking.rb @@ -15,8 +15,8 @@ module ActionController #:nodoc: } end - def render_with_benchmark(options = {}, deprecated_status = nil) - if logger.nil? + def render_with_benchmark(options = nil, deprecated_status = nil) + unless logger render_without_benchmark(options, deprecated_status) else db_runtime = ActiveRecord::Base.connection.reset_runtime if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected? @@ -35,7 +35,7 @@ module ActionController #:nodoc: end def perform_action_with_benchmark - if logger.nil? + unless logger perform_action_without_benchmark else runtime = [Benchmark::measure{ perform_action_without_benchmark }.real, 0.0001].max |