Skip to content

Commit e40a153

Browse files
committed
Stop trying to remove every file on extraction
When we're extracting a gem, it should be extracted to an empty directory. Trying to remove every file before extracting the file greatly slows the tar extraction process. This change increases tar extraction speed by about 10%: Master branch: ``` aaron@tc ~/g/tartest (main)> ruby -I../rubygems/lib:../vernier/lib test.rb {MEAN: 0.6701955500058829} {stddev: 0.029875687861609046} {"mib/s": 20.88942548167786} ``` This commit: ``` aaron@tc ~/g/tartest (main)> ruby -I../rubygems/lib:../vernier/lib test.rb {MEAN: 0.6002237499691546} {stddev: 0.03722422666707127} {"mib/s": 23.324635189326408} ```
1 parent fa1a80f commit e40a153

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/rubygems/package.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,6 @@ def extract_tar_gz(io, destination_dir, pattern = "*") # :nodoc:
436436
symlinks << [full_name, link_target, destination, real_destination]
437437
end
438438

439-
FileUtils.rm_rf destination
440-
441439
mkdir =
442440
if entry.directory?
443441
destination

0 commit comments

Comments
 (0)