diff options
| author | Samuel Giddins <segiddins@segiddins.me> | 2023-09-14 19:14:08 -0700 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-09-15 22:01:10 +0000 |
| commit | 2cf5fe58fbe8053f661552786a93d8cad7c307e0 (patch) | |
| tree | a7dde1755c88ec7ab29bf715dc48289c6e6e93b0 /ruby_assert.h | |
| parent | 4e8869c663f82f5745070e3bce8902b800b1b6a7 (diff) | |
[rubygems/rubygems] Avoid allocating empty hashes in Index
Since the hashes have a default proc that returns a (new) empty hash, we
can avoid allocating those empty hashes when we are only doing lookups.
Test from running `bundle update --bundler` against a rails app I have
lying around:
```
==> memprof.after.txt <==
Total allocated: 9.71 MB (68282 objects)
Total retained: 4.87 MB (33791 objects)
==> memprof.before.txt <==
Total allocated: 10.83 MB (100596 objects)
Total retained: 5.02 MB (34721 objects)
```
https://github.com/rubygems/rubygems/commit/8f7c9cb23e
Diffstat (limited to 'ruby_assert.h')
0 files changed, 0 insertions, 0 deletions
