ソースを参照

Remove Sync() call in NewTempArchive:

This makes the "Buffering to disk" part of `docker push` 70% faster in
my use-case (having already applied #12833).

fsync'ing here serves no valuable purpose: if the drive's operation is
interrupted, so it the program's, and this archive has no value other
than the immediate and transient one.

Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
Burke Libbey 10 年 前
コミット
236dbc2e59
1 ファイル変更0 行追加3 行削除
  1. 0 3
      pkg/archive/archive.go

+ 0 - 3
pkg/archive/archive.go

@@ -794,9 +794,6 @@ func NewTempArchive(src Archive, dir string) (*TempArchive, error) {
 	if _, err := io.Copy(f, src); err != nil {
 	if _, err := io.Copy(f, src); err != nil {
 		return nil, err
 		return nil, err
 	}
 	}
-	if err = f.Sync(); err != nil {
-		return nil, err
-	}
 	if _, err := f.Seek(0, 0); err != nil {
 	if _, err := f.Seek(0, 0); err != nil {
 		return nil, err
 		return nil, err
 	}
 	}