aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorVishal Telangre <the@vishaltelangre.com>2019-04-16 03:45:39 +0530
committerVishal Telangre <the@vishaltelangre.com>2019-04-16 03:45:39 +0530
commit547ebcb91e955a1d114c827737c9eb6845a8ca97 (patch)
tree773064d28974952c051c84c211afe7389a358969 /activesupport
parentf2a80db56b9e8d5b33127356036602431dc08cd5 (diff)
downloadrails-547ebcb91e955a1d114c827737c9eb6845a8ca97.tar.gz
rails-547ebcb91e955a1d114c827737c9eb6845a8ca97.tar.bz2
rails-547ebcb91e955a1d114c827737c9eb6845a8ca97.zip
Remove @duration instance variable since we're not maintaining instances variables such as @cpu_time, @idle_time and @allocations; this reduces one allocation
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/notifications/instrumenter.rb3
1 files changed, 1 insertions, 2 deletions
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)