frostfs-node/pkg/services/tree
Evgenii Stratonikov d18eaf060d [#957] treesvc: Implement pairing heap
With a large number of objects in a flat tree, sorting the nodes
dominates the latency of the operation. This scales nonlinearly
as O(n log n). Pairing heap has O(1) insert, and O(log n) extractMin,
which allows us to have O(n + log n) = O(n) latency on the first
operation, albeit with a slight increase in total running time.
On a real cluster with 2m objects, the latency decreased from 25s to
15s.

```
goos: linux
goarch: amd64
pkg: git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/tree
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
                        │     cache     │               noparent               │
                        │    sec/op     │    sec/op     vs base                │
GetSubTree/latency-8      2349.9µ ± 19%   572.1µ ± 17%  -75.65% (p=0.000 n=10)
GetSubTree/total_time-8    70.62m ±  8%   86.02m ±  3%  +21.81% (p=0.000 n=10)
geomean                    12.88m         7.015m        -45.54%

                        │    cache     │               noparent               │
                        │     B/op     │     B/op      vs base                │
GetSubTree/latency-8      43.87Mi ± 0%   32.81Mi ± 0%  -25.22% (p=0.000 n=10)
GetSubTree/total_time-8   43.87Mi ± 0%   32.81Mi ± 0%  -25.22% (p=0.000 n=10)
geomean                   43.87Mi        32.81Mi       -25.22%

                        │    cache    │              noparent               │
                        │  allocs/op  │  allocs/op   vs base                │
GetSubTree/latency-8      400.0k ± 0%   500.0k ± 0%  +24.99% (p=0.000 n=10)
GetSubTree/total_time-8   400.0k ± 0%   500.0k ± 0%  +24.99% (p=0.000 n=10)
geomean                   400.0k        500.0k       +24.99%
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-02-06 14:14:49 +03:00
..
heap [#957] treesvc: Implement pairing heap 2024-02-06 14:14:49 +03:00
bench_test.go [#957] treesvc: Add benchmark for getSubTree 2024-02-03 00:19:22 +03:00
cache.go treesvc: Do not provide credentials unless TLS is used 2023-07-06 08:04:28 +00:00
container.go Rename package name 2023-03-07 16:38:26 +03:00
drop.go [#242] treesvc: Add tracing spans 2023-04-14 10:25:53 +00:00
getsubtree_test.go [#772] node: Apply gofumpt 2023-10-31 17:03:03 +03:00
metrics.go [#17] Add morph client metrics 2023-06-13 14:06:04 +03:00
options.go [#574] tree: Check if container is really removed 2023-08-21 12:50:20 +03:00
redirect.go [#146] node: Add trace_id to logs 2023-09-27 11:05:27 +03:00
replicator.go [#146] node: Add trace_id to logs 2023-09-27 11:05:27 +03:00
service.go [#957] treesvc: Implement pairing heap 2024-02-06 14:14:49 +03:00
service.pb.go [#922] Update files generated by protoc 2024-02-02 12:09:51 +00:00
service.proto [#335] treesvc: Sort nodes by Filename in GetSubTree 2023-07-20 10:14:10 +03:00
service_frostfs.pb.go [#557] services: Regenerate stable marshalers 2023-08-02 13:37:40 +00:00
service_grpc.pb.go [#922] Update files generated by protoc 2024-02-02 12:09:51 +00:00
signature.go [#772] node: Apply gofumpt 2023-10-31 17:03:03 +03:00
signature_test.go [#895] test: Fix NewLogger arguments list 2024-01-11 12:32:09 +00:00
sync.go [#857] golangci: Add protogetter linter 2023-12-12 16:27:02 +03:00
sync_test.go [#302] tree: Drop unused ctx 2023-05-02 16:54:06 +03:00
types.pb.go [#922] Update files generated by protoc 2024-02-02 12:09:51 +00:00
types.proto Rename package name 2023-03-07 16:38:26 +03:00
types_frostfs.pb.go [#557] services: Regenerate stable marshalers 2023-08-02 13:37:40 +00:00