Skip to content

Commit c1b0beb

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 a bit over 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 a3d3df0 commit c1b0beb

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

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)