frostfs-node/pkg/local_object_storage/metabase
Evgenii Stratonikov a49f0717b3
All checks were successful
Vulncheck / Vulncheck (push) Successful in 1m9s
Build / Build Components (push) Successful in 1m47s
Pre-commit hooks / Pre-commit (push) Successful in 1m45s
Tests and linters / Run gofumpt (push) Successful in 4m17s
Tests and linters / Lint (push) Successful in 4m44s
Tests and linters / Staticcheck (push) Successful in 4m44s
OCI image / Build container images (push) Successful in 5m0s
Tests and linters / gopls check (push) Successful in 5m38s
Tests and linters / Tests with -race (push) Successful in 5m55s
Tests and linters / Tests (push) Successful in 8m19s
[#1685] metabase: Cache frequently accessed singleton buckets
There are some buckets we access almost always, to check whether an
object is alive. In search we also iterate over lots of objects, and
`tx.Bucket()` shows itself a lot in pprof.
```
goos: linux
goarch: amd64
pkg: git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/metabase
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
                          │      1      │                  2                   │
                          │   sec/op    │    sec/op     vs base                │
Select/string_equal-8       4.753m ± 6%   3.969m ± 14%  -16.50% (p=0.000 n=10)
Select/string_not_equal-8   4.247m ± 9%   3.486m ± 11%  -17.93% (p=0.000 n=10)
Select/common_prefix-8      4.163m ± 5%   3.323m ±  5%  -20.18% (p=0.000 n=10)
Select/unknown-8            3.557m ± 3%   3.064m ±  8%  -13.85% (p=0.001 n=10)
geomean                     4.158m        3.445m        -17.15%

                          │      1       │                  2                   │
                          │     B/op     │     B/op      vs base                │
Select/string_equal-8       2.250Mi ± 0%   1.907Mi ± 0%  -15.24% (p=0.000 n=10)
Select/string_not_equal-8   2.250Mi ± 0%   1.907Mi ± 0%  -15.24% (p=0.000 n=10)
Select/common_prefix-8      2.250Mi ± 0%   1.907Mi ± 0%  -15.24% (p=0.000 n=10)
Select/unknown-8            2.243Mi ± 0%   1.900Mi ± 0%  -15.29% (p=0.000 n=10)
geomean                     2.248Mi        1.905Mi       -15.26%

                          │      1      │                  2                  │
                          │  allocs/op  │  allocs/op   vs base                │
Select/string_equal-8       56.02k ± 0%   47.03k ± 0%  -16.05% (p=0.000 n=10)
Select/string_not_equal-8   56.02k ± 0%   47.03k ± 0%  -16.05% (p=0.000 n=10)
Select/common_prefix-8      56.02k ± 0%   47.03k ± 0%  -16.05% (p=0.000 n=10)
Select/unknown-8            55.03k ± 0%   46.04k ± 0%  -16.34% (p=0.000 n=10)
geomean                     55.78k        46.78k       -16.12%
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2025-03-20 10:17:42 +00:00
..
bucket_cache.go [#1685] metabase: Cache frequently accessed singleton buckets 2025-03-20 10:17:42 +00:00
children.go [#772] node: Apply gofumpt 2023-10-31 17:03:03 +03:00
containers.go [#1598] golangci: Enable unparam linter 2025-01-14 09:06:47 +03:00
containers_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
control.go [#1568] storage: Remove "could not/can't/failed to" from error messages 2024-12-18 15:52:26 +00:00
control_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
counter.go [#1598] golangci: Enable unparam linter 2025-01-14 09:06:47 +03:00
counter_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
db.go [#1437] node: Use ctx for logging 2024-11-13 10:36:07 +03:00
db_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
delete.go [#1598] golangci: Enable unparam linter 2025-01-14 09:06:47 +03:00
delete_ec_test.go [#1493] metabase: Merge Inhume() and DropGraves() for tombstones 2024-11-14 06:47:04 +00:00
delete_meta_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
delete_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
errors.go [#481] Update frostfs-sdk-go and error pointer receivers 2023-08-09 10:26:53 +00:00
exists.go [#1685] metabase: Cache frequently accessed singleton buckets 2025-03-20 10:17:42 +00:00
exists_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
expired.go [#1323] metabase: Add expiration epoch buckets 2024-08-22 08:21:40 +00:00
expired_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
generic_test.go [#xx] Avoid manual management of files in tests 2023-08-14 14:01:39 +03:00
get.go Revert "[#1492] metabase: Ensure Unmarshal() is called on a cloned slice" 2025-01-09 14:34:20 +03:00
get_test.go [#1510] metabase/test: Fix BenchmarkGet 2024-12-13 13:18:43 +03:00
graveyard.go [#1568] storage: Remove "could not/can't/failed to" from error messages 2024-12-18 15:52:26 +00:00
graveyard_test.go [#1493] metabase: Merge Inhume() and DropGraves() for tombstones 2024-11-14 06:47:04 +00:00
index_test.go [#587] Do not use math/rand.Read 2023-08-09 16:02:44 +03:00
info.go [#2057] meta: Fix concurrent mode changes 2022-11-19 11:01:04 +03:00
inhume.go [#1598] golangci: Enable unparam linter 2025-01-14 09:06:47 +03:00
inhume_ec_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
inhume_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
iterators.go Revert "[#1492] metabase: Ensure Unmarshal() is called on a cloned slice" 2025-01-09 14:34:20 +03:00
iterators_test.go [#1523] metabase: Remove (*DB).IterateCoveredByTombstones 2024-11-29 10:49:24 +00:00
list.go [#1606] Use slices.Clone()/bytes.Clone() where possible 2025-01-17 14:50:14 +03:00
list_test.go [#1583] metabase/test: Update TestLisObjectsWithCursor 2024-12-26 14:39:50 +03:00
lock.go [#1685] metabase: Cache frequently accessed singleton buckets 2025-03-20 10:17:42 +00:00
lock_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
metrics.go [#1121] node: Change mode of shard components 2024-06-05 05:55:24 +00:00
mode.go [#1568] storage: Remove "could not/can't/failed to" from error messages 2024-12-18 15:52:26 +00:00
mode_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
put.go Revert "[#1492] metabase: Ensure Unmarshal() is called on a cloned slice" 2025-01-09 14:34:20 +03:00
put_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
reset_test.go [#1671] Use fmt.Appendf where warranted 2025-03-13 08:12:20 +00:00
select.go [#1685] metabase: Cache frequently accessed singleton buckets 2025-03-20 10:17:42 +00:00
select_test.go [#1683] metabase/test: Report allocs in benchmarkSelect() 2025-03-18 11:48:51 +00:00
shard_id.go [#1568] storage: Remove "could not/can't/failed to" from error messages 2024-12-18 15:52:26 +00:00
storage_id.go [#1598] golangci: Enable unparam linter 2025-01-14 09:06:47 +03:00
storage_id_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00
upgrade.go [#1613] morph: Add tracing for morph queries to neo-go 2025-02-05 16:38:20 +03:00
upgrade_test.go [#1608] qos: Add qos service to adjust incoming IO tags 2025-02-07 15:43:03 +03:00
util.go [#1568] storage: Remove "could not/can't/failed to" from error messages 2024-12-18 15:52:26 +00:00
version.go [#1568] storage: Remove "could not/can't/failed to" from error messages 2024-12-18 15:52:26 +00:00
VERSION.md [#1323] metabase: Bump version 2024-08-22 08:21:40 +00:00
version_test.go [#1437] node: Fix contextcheck linter 2024-11-13 10:36:10 +03:00