From 4f40b2d8fbcfb437a628a353eb281553fc840728 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 24 Jul 2005 16:45:39 +0000 Subject: 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 --- actionpack/lib/action_controller/benchmarking.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_controller/benchmarking.rb') 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 -- cgit v1.2.3