Skip to content

Try to use metabase transaction context #1260

@fyrchik

Description

@fyrchik

One of the problems with the metabase is excessive convertions of addresses/CID/OIDs to use as keys or bucket names.
The cost is non-negligible as can be seen from the benchmarks (will provide them shortly).

Describe the solution you'd like

Introduce tx-level cache containing the most frequently used values.
Converting some items to string can be done outside of the transaction, we also can reuse the same slice for creating bucket names.

type txContext struct {
    tx *bbolt.Tx
   addr string
   cid string
   oid string
   bucketName []byte // preallocated bucket name
}

I have benched similar thing once, while trying it with pebble backend #619 , the result was positive. I think similar benefits are applicable to bolt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I4No visible changesS3Minimally significantU4Nothing urgentenhancementImproving existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions