[rubygems/rubygems] 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.https://github.com/rubygems/rubygems/commit/670195550005}
{stddev: 0.https://github.com/rubygems/rubygems/commit/029875687861}
{"mib/s": 20.https://github.com/rubygems/rubygems/commit/889425481677}
```

This commit:

```
aaron@tc ~/g/tartest (main)> ruby -I../rubygems/lib:../vernier/lib test.rb
{MEAN: 0.https://github.com/rubygems/rubygems/commit/600223749969}
{stddev: 0.https://github.com/rubygems/rubygems/commit/037224226667}
{"mib/s": 23.https://github.com/rubygems/rubygems/commit/324635189326}
```

https://github.com/rubygems/rubygems/commit/e40a153560
This commit is contained in:
Aaron Patterson 2025-09-16 17:45:02 +09:00 committed by Hiroshi SHIBATA
parent 5a07417c6f
commit e4fc0d4b3f

View File

@ -436,8 +436,6 @@ EOM
symlinks << [full_name, link_target, destination, real_destination]
end
FileUtils.rm_rf destination
mkdir =
if entry.directory?
destination