8b2f57dc6f
Method delegation with `...` argument is known to be slow because it allocates redundant Array and Hash objects each time when being called. see: https://bugs.ruby-lang.org/issues/19165 Current implementation of `delegate` defines all delegation methods in this slow form regardless of the original method's arity, but in case the delegation target is a Class or a Module, we can investigate the arity of the original method in the definition timing, then we can define the delegation in proper minimal arity. This makes 3.5 times faster zero arity method delegation as follows: Warming up -------------------------------------- old 811.534k i/100ms new 1.807M i/100ms Calculating ------------------------------------- old 9.809M (± 3.4%) i/s - 49.504M in 5.053355s new 34.360M (± 0.8%) i/s - 173.465M in 5.048692s Comparison: new: 34360408.4 i/s old: 9809157.4 i/s - 3.50x (± 0.00) slower |
||
---|---|---|
.. | ||
bin | ||
lib | ||
test | ||
.gitignore | ||
activesupport.gemspec | ||
CHANGELOG.md | ||
MIT-LICENSE | ||
Rakefile | ||
README.rdoc |
= Active Support -- Utility classes and Ruby extensions from Rails Active Support is a collection of utility classes and standard library extensions that were found useful for the Rails framework. These additions reside in this package so they can be loaded as needed in Ruby projects outside of Rails. You can read more about the extensions in the {Active Support Core Extensions}[https://edgeguides.rubyonrails.org/active_support_core_extensions.html] guide. == Download and installation The latest version of Active Support can be installed with RubyGems: $ gem install activesupport Source code can be downloaded as part of the Rails project on GitHub: * https://github.com/rails/rails/tree/main/activesupport == License Active Support is released under the MIT license: * https://opensource.org/licenses/MIT == Support API documentation is at: * https://api.rubyonrails.org Bug reports for the Ruby on Rails project can be filed here: * https://github.com/rails/rails/issues Feature requests should be discussed on the rails-core mailing list here: * https://discuss.rubyonrails.org/c/rubyonrails-core