mirror of
https://github.com/minio/minio.git
synced 2026-06-04 10:13:48 +08:00
Reduce WriteAll allocs (#10810)
WriteAll saw 127GB allocs in a 5 minute timeframe for 4MiB buffers used by `io.CopyBuffer` even if they are pooled. Since all writers appear to write byte buffers, just send those instead and write directly. The files are opened through the `os` package so they have no special properties anyway. This removes the alloc and copy for each operation. REST sends content length so a precise alloc can be made.
This commit is contained in:
@@ -78,7 +78,8 @@ type StorageAPI interface {
|
||||
VerifyFile(ctx context.Context, volume, path string, fi FileInfo) error
|
||||
|
||||
// Write all data, syncs the data to disk.
|
||||
WriteAll(ctx context.Context, volume string, path string, reader io.Reader) (err error)
|
||||
// Should be used for smaller payloads.
|
||||
WriteAll(ctx context.Context, volume string, path string, b []byte) (err error)
|
||||
|
||||
// Read all.
|
||||
ReadAll(ctx context.Context, volume string, path string) (buf []byte, err error)
|
||||
|
||||
Reference in New Issue
Block a user