minio/pkg
Harshavardhana 76e2713ffe
fix: use buffers only when necessary for io.Copy() (#11229)
Use separate sync.Pool for writes/reads

Avoid passing buffers for io.CopyBuffer()
if the writer or reader implement io.WriteTo or io.ReadFrom
respectively then its useless for sync.Pool to allocate
buffers on its own since that will be completely ignored
by the io.CopyBuffer Go implementation.

Improve this wherever we see this to be optimal.

This allows us to be more efficient on memory usage.
```
   385  // copyBuffer is the actual implementation of Copy and CopyBuffer.
   386  // if buf is nil, one is allocated.
   387  func copyBuffer(dst Writer, src Reader, buf []byte) (written int64, err error) {
   388  	// If the reader has a WriteTo method, use it to do the copy.
   389  	// Avoids an allocation and a copy.
   390  	if wt, ok := src.(WriterTo); ok {
   391  		return wt.WriteTo(dst)
   392  	}
   393  	// Similarly, if the writer has a ReadFrom method, use it to do the copy.
   394  	if rt, ok := dst.(ReaderFrom); ok {
   395  		return rt.ReadFrom(src)
   396  	}
```

From readahead package
```
// WriteTo writes data to w until there's no more data to write or when an error occurs.
// The return value n is the number of bytes written.
// Any error encountered during the write is also returned.
func (a *reader) WriteTo(w io.Writer) (n int64, err error) {
	if a.err != nil {
		return 0, a.err
	}
	n = 0
	for {
		err = a.fill()
		if err != nil {
			return n, err
		}
		n2, err := w.Write(a.cur.buffer())
		a.cur.inc(n2)
		n += int64(n2)
		if err != nil {
			return n, err
		}
```
2021-01-06 09:36:55 -08:00
..
argon2 fix: refactor locks to apply them uniquely per node (#11052) 2020-12-10 07:28:37 -08:00
auth fix: remove LDAP groups claim and store them on server (#9637) 2020-05-20 11:33:35 -07:00
bandwidth Add basic bandwidth monitoring for replication. (#10501) 2020-10-09 20:36:00 -07:00
bpool Replace Minio refs in docs with MinIO and links (#7494) 2019-04-09 11:39:42 -07:00
bucket fix: marshaling stack overflow in noncurrentversion lifecycle config (#10971) 2020-11-24 20:43:11 -08:00
certs feat: treat /var/run/secrets/ on k8s as system cert directory (#11123) 2020-12-16 18:24:12 -08:00
cgroup Replace Minio refs in docs with MinIO and links (#7494) 2019-04-09 11:39:42 -07:00
color Bring in safe mode support (#8478) 2019-11-09 09:27:23 -08:00
console add _MINIO_SERVER_DEBUG env for enabling debug messages (#11128) 2020-12-17 16:52:47 -08:00
csvparser sql, csv: Cache some values between Read() calls to gain performance (#9645) 2020-05-22 10:15:08 -07:00
disk fix: remove inode free as part of SameDisk check (#11107) 2020-12-15 11:39:38 -08:00
dsync fix: refactor locks to apply them uniquely per node (#11052) 2020-12-10 07:28:37 -08:00
ellipses Replace Minio refs in docs with MinIO and links (#7494) 2019-04-09 11:39:42 -07:00
env Add crawler delay config + dynamic config values (#11018) 2020-12-04 09:32:35 -08:00
event update deps to latest for some vulnerable deps (#11080) 2020-12-10 13:23:06 -08:00
handlers List v1/versions routes based on source IP if found (#10603) 2020-09-30 13:38:27 -07:00
hash add comment on exported error 2020-05-15 18:17:54 -07:00
iam/policy Rename OBD to Health (#10842) 2020-11-20 12:52:53 -08:00
ioutil fix: use buffers only when necessary for io.Copy() (#11229) 2021-01-06 09:36:55 -08:00
licverifier Add ExpiresAt to LicenseInfo (#10293) 2020-08-19 19:21:04 -07:00
lock fix: Allow Walk to honor load balanced drives (#10610) 2020-10-01 20:24:34 -07:00
lsync delayed locks until we have started reading the body (#10474) 2020-09-14 15:57:13 -07:00
madmin fix: healing buckets during pool expansion (#11224) 2021-01-05 13:24:22 -08:00
mimedb Replace Minio refs in docs with MinIO and links (#7494) 2019-04-09 11:39:42 -07:00
mountinfo Cache Windows mount point info (#8572) 2019-11-27 20:10:13 +05:30
net Unwrap network errors (#10934) 2020-11-20 22:55:35 -08:00
pubsub tracing: NumSubscribers() to use atomic instead of mutex (#11219) 2021-01-04 09:40:30 -08:00
quick fix: etcd import paths again depend on v3.4.14 release (#11020) 2020-12-03 11:35:18 -08:00
rpc Upgrade compress and pgzip package (#10992) 2020-11-27 10:10:15 -08:00
s3select fix: docs typos and keywords 2020-12-23 11:59:20 -08:00
safe Replace Minio refs in docs with MinIO and links (#7494) 2019-04-09 11:39:42 -07:00
smart add NVMe drive info [model num, serial num, drive temp. etc.] (#10613) 2020-10-04 10:18:46 -07:00
sync/errgroup Replace Minio refs in docs with MinIO and links (#7494) 2019-04-09 11:39:42 -07:00
sys Use hw.physmem64 instead of hw.physmem for NetBSD in pkg/sys/getHwPhysmem (#10907) 2020-11-16 20:53:47 -08:00
trace feat: time to bring back http2.0 support (#10230) 2020-08-10 09:02:29 -07:00
trie fix: [fs] CompleteMultipart use trie structure for partMatch (#10522) 2020-09-21 01:18:13 -07:00
wildcard Simplify cast of string to rune slice in wildcard matching (#9577) 2020-05-14 08:20:13 -07:00
words Replace Minio refs in docs with MinIO and links (#7494) 2019-04-09 11:39:42 -07:00