1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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>
This commit is contained in:
Burke Libbey 2015-05-07 12:58:12 -04:00
parent 4676ff3fd7
commit 236dbc2e59
No known key found for this signature in database
GPG key ID: E893DEF914F22410

View file

@ -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
}