mirror of
https://github.com/pgsty/minio.git
synced 2026-07-23 22:16:15 +03:00
tree-walk: optimize tree walk such that leaf detection of entries is delayed till the entry is sent on the treeWalkResult channel. (#2220)
This commit is contained in:
committed by
Harshavardhana
parent
aeac902747
commit
27a5b61f40
@@ -532,10 +532,14 @@ func (fs fsObjects) listObjects(bucket, prefix, marker, delimiter string, maxKey
|
||||
walkResultCh, endWalkCh := fs.listPool.Release(listParams{bucket, recursive, marker, prefix})
|
||||
if walkResultCh == nil {
|
||||
endWalkCh = make(chan struct{})
|
||||
listDir := listDirFactory(func(bucket, object string) bool {
|
||||
isLeaf := func(bucket, object string) bool {
|
||||
// bucket argument is unused as we don't need to StatFile
|
||||
// to figure if it's a file, just need to check that the
|
||||
// object string does not end with "/".
|
||||
return !strings.HasSuffix(object, slashSeparator)
|
||||
}, fs.storage)
|
||||
walkResultCh = startTreeWalk(bucket, prefix, marker, recursive, listDir, endWalkCh)
|
||||
}
|
||||
listDir := listDirFactory(isLeaf, fs.storage)
|
||||
walkResultCh = startTreeWalk(bucket, prefix, marker, recursive, listDir, isLeaf, endWalkCh)
|
||||
}
|
||||
var fileInfos []FileInfo
|
||||
var eof bool
|
||||
|
||||
Reference in New Issue
Block a user