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 /activesupport/lib/active_support/cache/strategy | |
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 'activesupport/lib/active_support/cache/strategy')
-rw-r--r-- | activesupport/lib/active_support/cache/strategy/local_cache.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/cache/strategy/local_cache.rb b/activesupport/lib/active_support/cache/strategy/local_cache.rb index fb42c4a41e..cea7eee924 100644 --- a/activesupport/lib/active_support/cache/strategy/local_cache.rb +++ b/activesupport/lib/active_support/cache/strategy/local_cache.rb @@ -23,6 +23,9 @@ module ActiveSupport def set_cache_for(local_cache_key, value) @registry[local_cache_key] = value end + + def self.set_cache_for(l, v); instance.set_cache_for l, v; end + def self.cache_for(l); instance.cache_for l; end end # Simple memory backed cache. This cache is not thread safe and is intended only |