summaryrefslogtreecommitdiff
path: root/lib/rubygems/basic_specification.rb
diff options
context:
space:
mode:
authorSamuel Giddins <[email protected]>2023-09-18 14:07:41 -0700
committergit <[email protected]>2023-09-19 07:25:51 +0000
commit4023637d20e4f9c4c4806e0fb27f868eea7612b3 ()
tree1282c43f9412b198487c352ba6d6eb75ceaca502 /lib/rubygems/basic_specification.rb
parentcea7e6ecca99ae7730ea5ac44ed15f62b1599664 (diff)
[rubygems/rubygems] Reduce allocations for stub specifications
This helps with memory usage during application boot time ``` ==> memprof.after.txt <== Total allocated: 1.43 MB (18852 objects) Total retained: 421.12 kB (4352 objects) ==> memprof.before.txt <== Total allocated: 2.43 MB (28355 objects) Total retained: 469.69 kB (5425 objects) ``` See https://bugs.ruby-lang.org/issues/19890 about the readline allocations https://.com/rubygems/rubygems/commit/d7eb66eee3
-rw-r--r--lib/rubygems/basic_specification.rb4
1 files changed, 2 insertions, 2 deletions
@@ -133,9 +133,9 @@ class Gem::BasicSpecification
def full_name
if platform == Gem::Platform::RUBY || platform.nil?
- "#{name}-#{version}".dup.tap(&Gem::UNTAINT)
else
- "#{name}-#{version}-#{platform}".dup.tap(&Gem::UNTAINT)
end
end