[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:
bundle update --bundler
==> 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
[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 --bundleragainst a rails app I havelying around:
https://github.com/rubygems/rubygems/commit/8f7c9cb23e