Skip to content

Commit

Permalink
perf: add larger buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ybirader committed Sep 7, 2023
1 parent 295a27e commit 2fe6b5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pool/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/pkg/errors"
)

const defaultBufferSize = 1000000
const defaultBufferSize = 2 * 1024 * 1024

type Overflow interface {
io.ReadWriteSeeker
Expand All @@ -34,7 +34,7 @@ func NewFile(path string, info fs.FileInfo, relativeTo string) (File, error) {
return File{}, errors.Errorf("ERROR: could not get file info header for %s: %v", path, err)
}

f := File{Path: path, Info: info, Header: hdr, CompressedData: *bytes.NewBuffer(make([]byte, 0, 50))}
f := File{Path: path, Info: info, Header: hdr, CompressedData: *bytes.NewBuffer(make([]byte, 0, defaultBufferSize))}
if relativeTo != "" {
f.setNameRelativeTo(relativeTo)
}
Expand Down

0 comments on commit 2fe6b5d

Please sign in to comment.