From a080d36f704d611594e9e6322cc89e1da34f4cf3 Mon Sep 17 00:00:00 2001 From: Burke Libbey Date: Thu, 7 May 2015 12:58:12 -0400 Subject: [PATCH] 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 --- archive/archive.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/archive/archive.go b/archive/archive.go index 4d8d260..fbcaf2f 100644 --- a/archive/archive.go +++ b/archive/archive.go @@ -794,9 +794,6 @@ func NewTempArchive(src Archive, dir string) (*TempArchive, error) { if _, err := io.Copy(f, src); err != nil { return nil, err } - if err = f.Sync(); err != nil { - return nil, err - } if _, err := f.Seek(0, 0); err != nil { return nil, err }