mirror of https://github.com/pkg/sftp.git
give the bytes.Buffer a preallocated slice to use for less variance
This commit is contained in:
parent
91163e4463
commit
addaabd30b
|
|
@ -2473,7 +2473,7 @@ func benchmarkWriteTo(b *testing.B, bufsize int, delay time.Duration) {
|
|||
f.Write(data)
|
||||
f.Close()
|
||||
|
||||
buf := new(bytes.Buffer)
|
||||
buf := bytes.NewBuffer(make([]byte, 0, size))
|
||||
|
||||
b.ResetTimer()
|
||||
b.SetBytes(int64(size))
|
||||
|
|
|
|||
Loading…
Reference in New Issue