frostfs-node/pkg/local_object_storage
Evgenii Stratonikov 81f925d5a0 [#1516] metabase: Optimize ListWithCursor for long listings
Cache buckets outside of the main loop and allocate memory for the
resulting offset only once.

```
name                        old time/op    new time/op    delta
ListWithCursor/1_item-8       6.45µs ±14%    5.79µs ±11%  -10.24%  (p=0.002 n=10+10)
ListWithCursor/10_items-8     20.9µs ±17%    17.3µs ± 9%  -17.27%  (p=0.000 n=10+10)
ListWithCursor/100_items-8     153µs ±12%     131µs ± 9%  -14.63%  (p=0.000 n=10+10)

name                        old alloc/op   new alloc/op   delta
ListWithCursor/1_item-8       2.31kB ± 0%    1.91kB ± 0%  -17.46%  (p=0.000 n=10+10)
ListWithCursor/10_items-8     6.94kB ± 0%    5.50kB ± 0%  -20.78%  (p=0.000 n=8+8)
ListWithCursor/100_items-8    53.3kB ± 0%    41.5kB ± 0%  -22.18%  (p=0.000 n=10+10)

name                        old allocs/op  new allocs/op  delta
ListWithCursor/1_item-8         40.0 ± 0%      34.0 ± 0%  -15.00%  (p=0.000 n=10+10)
ListWithCursor/10_items-8        121 ± 0%       100 ± 0%  -17.36%  (p=0.000 n=10+10)
ListWithCursor/100_items-8       930 ± 0%       758 ± 0%  -18.49%  (p=0.000 n=10+10)
```

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-06-15 20:49:41 +03:00
..
blobovnicza [#1460] blobovnicza: Do not use pointers as the results 2022-06-06 18:03:12 +03:00
blobstor [#1460] blobstor: Do not use pointers as the results 2022-06-06 18:03:12 +03:00
engine [#1494] *: Fix linter warnings 2022-06-15 12:26:10 +03:00
internal/log [#790] storage engine: Add common template of log messages 2021-09-13 15:02:13 +03:00
metabase [#1516] metabase: Optimize ListWithCursor for long listings 2022-06-15 20:49:41 +03:00
shard [#1460] blobstor: Do not use pointers as the results 2022-06-06 18:03:12 +03:00
util [#1454] Upgrade NeoFS SDK Go module with new IDs 2022-06-01 17:41:45 +03:00
writecache writecache: provide timeout to bbolt.Open 2022-06-09 14:19:47 +03:00