1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview
Aaron Patterson 13c4cc3b5a remove object hash cache
I don't think caching this method makes any difference on Ruby 2.0:

```
require 'benchmark/ips'

class Foo
  alias :object_hash :hash
  attr_reader :hash
  def initialize
    @hash = object_hash
  end
end

class Bar
end

hash = {}
foo = Foo.new
bar = Bar.new
Benchmark.ips do |x|
  x.report("foo") { hash[foo] }
  x.report("bar") { hash[bar] }

  x.report("foo.hash") { foo.hash }
  x.report("bar.hash") { bar.hash }
end

__END__
[aaron@TC ruby (trunk)]$ ruby test.rb
Warming up --------------------------------------
                 foo   118.361k i/100ms
                 bar   118.637k i/100ms
Calculating -------------------------------------
                 foo      7.944M (± 3.1%) i/s -     39.769M
                 bar      7.931M (± 3.4%) i/s -     39.625M
[aaron@TC ruby (trunk)]$ ruby test.rb
Warming up --------------------------------------
                 foo   122.180k i/100ms
                 bar   120.492k i/100ms
            foo.hash   123.397k i/100ms
            bar.hash   119.312k i/100ms
Calculating -------------------------------------
                 foo      8.002M (± 4.2%) i/s -     39.953M
                 bar      8.037M (± 4.5%) i/s -     40.124M
            foo.hash      8.819M (± 3.9%) i/s -     44.053M
            bar.hash      7.856M (± 4.1%) i/s -     39.254M
```
2016-02-18 07:50:53 -08:00
..
bin select the AR adapter through bin/test. 2015-06-11 14:24:56 +02:00
lib remove object hash cache 2016-02-18 07:50:53 -08:00
test Merge pull request #23662 from rthbound/adds-missing-digestor-nested-deps-tests 2016-02-17 14:36:43 +01:00
actionview.gemspec Upgrade to Ruby 2.2.2 2015-04-14 08:41:56 +05:30
CHANGELOG.md Fix grammar a to an [ci skip] 2016-02-13 20:44:44 +09:00
MIT-LICENSE Update copyright notices to 2016 [ci skip] 2015-12-31 18:27:19 +02:00
Rakefile Wrangle the asset build into something that sounds more general 2016-02-01 05:03:03 +10:30
README.rdoc [ci skip] Add a dollar sign to each command in the READMEs 2015-12-06 19:18:52 +01:00
RUNNING_UNIT_TESTS.rdoc

= Action View

Action View is a framework for handling view template lookup and rendering, and provides
view helpers that assist when building HTML forms, Atom feeds and more.
Template formats that Action View handles are ERB (embedded Ruby, typically
used to inline short Ruby snippets inside HTML), and XML Builder.

== Download and installation

The latest version of Action View can be installed with RubyGems:

  $ gem install actionview

Source code can be downloaded as part of the Rails project on GitHub

* https://github.com/rails/rails/tree/master/actionview


== License

Action View is released under the MIT license:

* http://www.opensource.org/licenses/MIT


== Support

API documentation is at

* http://api.rubyonrails.org

Bug reports can be filed for the Ruby on Rails project here:

* https://github.com/rails/rails/issues

Feature requests should be discussed on the rails-core mailing list here:

* https://groups.google.com/forum/?fromgroups#!forum/rubyonrails-core