aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/per_thread_registry.rb
Commit message (Collapse)AuthorAgeFilesLines
* Accessing ivar with Symbols might be just a very little bit better than with ↵Akira Matsuda2019-07-311-1/+1
| | | | fstrings
* [Active Support] require_relative => requireAkira Matsuda2017-10-211-1/+1
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-011-1/+1
|
* Privatize unneededly protected methods in Active SupportAkira Matsuda2016-12-241-2/+2
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* [ci skip] Add link to method referenced in ActiveSupport::PerThreadRegistryAlex Kitchens2016-06-241-1/+1
|
* Add thread_m/cattr_accessor/reader/writer suite of methods for declaring ↵David Heinemeier Hansson2015-12-171-0/+3
| | | | class and module variables that live per-thread
* Add missing requireMatthew Draper2015-11-191-0/+2
| | | | Fixes #22311
* Avoid leaking the first relation we call #first onMatthew Draper2015-10-091-3/+3
| | | | | | | | With the previous implementation, the block passed to define_singleton_method, which will live forever as the method body, captures the parameters (args and block) in its enclosure. For the current_scope registry, that can include an AR::Relation.
* Perf: save ~9% of object allocations on heavy requests.Jeremy Kemper2013-12-121-2/+5
| | | | | | | | | | | | | The per-thread registry is keyed on the class name, and each request for the class name returns a new string. This is in the hot path for a lot of Active Record behavior, so we easily accumulate thousands of repeated strings. To fix, we simply cache the key when the class is first extended with the module. TODO: Eliminate this module. The per-thread instance concept is common, but this technique confuses and obfuscates.
* Stop using method missing for singleton delegation.Aaron Patterson2013-11-061-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* use define_singleton_method instead of class_evalFrancesco Rodriguez2013-04-131-4/+2
|
* Add :nodoc: mark to PerThreadRegistry#method_missing [ci skip]Francesco Rodriguez2013-04-131-1/+1
|
* hides the per thread registry instance, and caches singleton methodsXavier Noria2013-04-131-19/+29
| | | | | | | | | | | | Existing code was delegating to the instance with delegate macro calls, or invoking the instance method to reach the object and call its instance methods. But the point is to have a clean class-level interface where the thread local instance is hidden in the implementation. References #11c6973. References #10198.
* complete rewrite of the documentation of AS::PerThreadRegistryXavier Noria2013-04-131-21/+24
| | | | | | | | | | * It focuses on how to use it. * Removes some ambigueties in the original docs about whether the state is stored in the class. * Documents it provides class-level accessors via method_missing. * Documents that if the extended class has an initializer, it must accept no arguments.
* Using public send instead of send for the PerThreadRegistry module.wangjohn2013-04-101-1/+1
| | | | Prevents you from accidentally calling a protected method.
* Creating a module so that per thread registries can be easily created aswangjohn2013-04-091-0/+41
thread local variables.