[#2210] pilorama: Allocate bucket name outside of batches

1. Reduce allocations inside transactions.
2. Do not encode container ID to string: it allocates a lot and takes more
space.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-01-18 09:38:42 +03:00 committed by fyrchik
parent 165a600624
commit 25d5995cef
2 changed files with 18 additions and 9 deletions

View file

@ -34,8 +34,9 @@ func (b *batch) run() {
sort.Slice(b.operations, func(i, j int) bool {
return b.operations[i].Time < b.operations[j].Time
})
fullID := bucketName(b.cid, b.treeID)
err := b.forest.db.Update(func(tx *bbolt.Tx) error {
bLog, bTree, err := b.forest.getTreeBuckets(tx, b.cid, b.treeID)
bLog, bTree, err := b.forest.getTreeBuckets(tx, fullID)
if err != nil {
return err
}