From 2407e5f5ff2399078a984d2e031bf3cefef64053 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Tue, 10 Oct 2023 18:22:53 +0300 Subject: [PATCH] [#661] blobovniczatree: Do not sort DB's and indicies Put stores object to next active DB, so there is no need to sort DBs. In addition, it adds unnecessary DB openings. Signed-off-by: Dmitrii Stepanov --- pkg/local_object_storage/blobstor/blobovniczatree/iterate.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/local_object_storage/blobstor/blobovniczatree/iterate.go b/pkg/local_object_storage/blobstor/blobovniczatree/iterate.go index 5115439b..92014fd5 100644 --- a/pkg/local_object_storage/blobstor/blobovniczatree/iterate.go +++ b/pkg/local_object_storage/blobstor/blobovniczatree/iterate.go @@ -134,7 +134,9 @@ func (b *Blobovniczas) iterateSorted(ctx context.Context, addr *oid.Address, cur } indices := indexSlice(levelWidth) - hrw.SortSliceByValue(indices, addressHash(addr, filepath.Join(curPath...))) + if !isLeafLevel { + hrw.SortSliceByValue(indices, addressHash(addr, filepath.Join(curPath...))) + } exec := uint64(len(curPath)) == execDepth @@ -249,7 +251,6 @@ func (b *Blobovniczas) iterateSordedDBPathsInternal(ctx context.Context, path st } if len(dbIdxs) > 0 { - hrw.SortSliceByValue(dbIdxs, addressHash(&addr, path)) for _, dbIdx := range dbIdxs { dbPath := filepath.Join(path, u64ToHexStringExt(dbIdx)) stop, err := f(dbPath)