performance: added wrapper around io.Copy()

this pools copy buffers so they can be reused instead of throwing away
after each io.Copy()
This commit is contained in:
Jarek Kowalski committed 2020-03-10 21:52:30 -07:00
1 parent ec56ed3d70
commit 514df69afa
16 files changed
+63 -26

No files matched your search

+2 -1
View File
@@ -13,6 +13,7 @@ import (
"github.com/pkg/errors"
"github.com/kopia/kopia/fs"
"github.com/kopia/kopia/internal/iocopy"
"github.com/kopia/kopia/repo/logging"
"github.com/kopia/kopia/repo/object"
)
@@ -280,7 +281,7 @@ func downloadFile(ctx context.Context, f fs.File, fname string) error {
}
defer dst.Close() //nolint:errcheck
_, err = io.Copy(dst, src)
_, err = iocopy.Copy(dst, src)
return err
}