increase readdir per block memory to facilitate faster WalkDir (#10908)

This commit is contained in:
Harshavardhana
2020-11-18 09:21:02 -08:00
committed by GitHub
parent 7ff8128f15
commit 9738d605e4

View File

@@ -31,10 +31,10 @@ import (
// refer https://github.com/golang/go/issues/24015
const blockSize = 8 << 10 // 8192
// By default atleast 20 entries in single getdents call
// By default atleast 128 entries in single getdents call (1MiB buffer)
var direntPool = sync.Pool{
New: func() interface{} {
buf := make([]byte, blockSize*20)
buf := make([]byte, blockSize*128)
return &buf
},
}