[rubygems/rubygems] Use Array#concat
in SpecSet#for
to save memory
On `rails/rails` repository Gemfile, running the following script ``` # script.rb require "bundler/setup" ``` #### Before ``` ➜ rails git:(main) ✗ BUNDLER_VERSION=2.4.0.dev ruby-memory-profiler --pretty --no-detailed --allocated-strings=0 --retained-strings=0 script.rb Total allocated: 24.37 MB (207937 objects) Total retained: 2.98 MB (34152 objects) ``` #### After ``` ➜ rails git:(main) ✗ BUNDLER_VERSION=2.4.0.dev ruby-memory-profiler --pretty --no-detailed --allocated-strings=0 --retained-strings=0 script.rb Total allocated: 22.27 MB (206856 objects) Total retained: 2.98 MB (34152 objects) ``` https://github.com/rubygems/rubygems/commit/2ea2523afd Co-authored-by: Josh Nichols <josh.nichols@gusto.com>
This commit is contained in:
parent
c380aac19d
commit
641c3830df
@ -24,7 +24,7 @@ module Bundler
|
||||
|
||||
specs_for_dep = spec_for_dependency(dep, match_current_platform)
|
||||
if specs_for_dep.any?
|
||||
specs += specs_for_dep
|
||||
specs.concat(specs_for_dep)
|
||||
|
||||
specs_for_dep.first.dependencies.each do |d|
|
||||
next if d.type == :development
|
||||
|
Loading…
x
Reference in New Issue
Block a user