rubygems/rubygems — pull request #556 by grk (2013-05-13 10:26:57+00:00)
Title: Don't fsync every file when installing gems

d84090b introduced "similar sync behavior from old tar code". It looks like the old code was fsyncing directories, but the commit was fsyncing every single file.

This fixes a severe performance degradation in our virtualized environment. Gem install takes ~40 seconds on rubygems 2.0 compared to ~1 second on rubygems 1.8.

I looked through the last version that didn't have those performance issues - 1.8.25 - and the Gem::Package::FSyncDir module is dead code there.

I don't know rubygems well enough to say if its absolutely safe to remove this code, but from my limited testing it seems that it is. I installed a few gems with checking if any TarReader::Entry is a directory, and none of them is.