Use pools.Copy instead of io.Copy for overlay.copyRegular
That function is pretty heavy used on container start. Autoallocating buffer can be painful. Signed-off-by: Alexander Morozov <lk4d4@docker.com> Upstream-commit: 3f5e1c69b345b25d9b1c57f5d492a0e3fd4432a0 Component: engine
This commit is contained in:
@ -4,12 +4,12 @@ package overlay
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/pkg/pools"
|
||||
"github.com/docker/docker/pkg/system"
|
||||
)
|
||||
|
||||
@ -32,7 +32,7 @@ func copyRegular(srcPath, dstPath string, mode os.FileMode) error {
|
||||
}
|
||||
defer dstFile.Close()
|
||||
|
||||
_, err = io.Copy(dstFile, srcFile)
|
||||
_, err = pools.Copy(dstFile, srcFile)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user