diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-11-06 16:32:47 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-11-06 16:32:47 -0800 |
commit | 5584ddc43da6f3275c45305f50d934e505750f8c (patch) | |
tree | 5345718680aae6e9f29fb894b64c3c1d192c19f3 /activerecord/lib | |
parent | 4d15661d6c46c86a62ee1fc358f4b3ef9dd9f2ea (diff) | |
download | rails-5584ddc43da6f3275c45305f50d934e505750f8c.tar.gz rails-5584ddc43da6f3275c45305f50d934e505750f8c.tar.bz2 rails-5584ddc43da6f3275c45305f50d934e505750f8c.zip |
Stop using method missing for singleton delegation.
This saved about 46 array allocations per request on an extremely simple
application. The delegation happened in the notification subsystem
which is a hotspot, so this should result in even more savings with
larger apps.
Squashed commit of the following:
commit 41eef0d1479526f7de25fd4391d98e61c126d9f5
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Wed Nov 6 16:32:31 2013 -0800
speed up notifications
commit 586b4a18656f66fb2c518fb8e8fee66a016e8ae6
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Wed Nov 6 16:31:05 2013 -0800
speed up runtime registry methods
commit b67d074cb4314df9a88438f785868cef77e583d7
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Wed Nov 6 16:28:12 2013 -0800
change method name and make it public
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/runtime_registry.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/runtime_registry.rb b/activerecord/lib/active_record/runtime_registry.rb index 63e6738622..9d605b826a 100644 --- a/activerecord/lib/active_record/runtime_registry.rb +++ b/activerecord/lib/active_record/runtime_registry.rb @@ -13,5 +13,10 @@ module ActiveRecord extend ActiveSupport::PerThreadRegistry attr_accessor :connection_handler, :sql_runtime, :connection_id + + [:connection_handler, :sql_runtime, :connection_id].each do |val| + class_eval %{ def self.#{val}; instance.#{val}; end }, __FILE__, __LINE__ + class_eval %{ def self.#{val}=(x); instance.#{val}=x; end }, __FILE__, __LINE__ + end end end |