diff options
author | schneems <richard.schneeman+foo@gmail.com> | 2018-09-20 23:09:10 -0500 |
---|---|---|
committer | schneems <richard.schneeman+foo@gmail.com> | 2018-09-21 17:33:17 -0500 |
commit | 6da99b4e99c90c63015f0d1cb4bf10983ea26a36 (patch) | |
tree | e8eb9495ea8d4dbdd89d0631e0ef9517343060b2 /Gemfile | |
parent | a44b7f180d0f03613479fb227d09ce2d7f74a187 (diff) | |
download | rails-6da99b4e99c90c63015f0d1cb4bf10983ea26a36.tar.gz rails-6da99b4e99c90c63015f0d1cb4bf10983ea26a36.tar.bz2 rails-6da99b4e99c90c63015f0d1cb4bf10983ea26a36.zip |
Decrease memory allocations in cache.rb
The `merged_options` method is private and the output is never mutated.
Using this info we can get rid of the `dup` behavior. We can also
eliminate the `merge` call in the case where all the options being merged are the same.
Returned results are frozen as an extra layer of protection against
mutation.
Before
```
Total allocated: 741749 bytes (6642 objects)
```
After
```
Total allocated: 734039 bytes (6648 objects)
```
Diff
```
(741749 - 734039) / 741749.0 => ~ 1.0 %
```
If you don't feel comfortable modifying this method, we could rename it
and only use it internally.
Diffstat (limited to 'Gemfile')
0 files changed, 0 insertions, 0 deletions