From 547ebcb91e955a1d114c827737c9eb6845a8ca97 Mon Sep 17 00:00:00 2001 From: Vishal Telangre Date: Tue, 16 Apr 2019 03:45:39 +0530 Subject: Remove @duration instance variable since we're not maintaining instances variables such as @cpu_time, @idle_time and @allocations; this reduces one allocation --- activesupport/lib/active_support/notifications/instrumenter.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/notifications/instrumenter.rb b/activesupport/lib/active_support/notifications/instrumenter.rb index 1940b33799..12546511a8 100644 --- a/activesupport/lib/active_support/notifications/instrumenter.rb +++ b/activesupport/lib/active_support/notifications/instrumenter.rb @@ -68,7 +68,6 @@ module ActiveSupport @transaction_id = transaction_id @end = ending @children = [] - @duration = nil @cpu_time_start = 0 @cpu_time_finish = 0 @allocation_count_start = 0 @@ -125,7 +124,7 @@ module ActiveSupport # # @event.duration # => 1000.138 def duration - @duration ||= 1000.0 * (self.end - time) + 1000.0 * (self.end - time) end def <<(event) -- cgit v1.2.3