Repository navigation
Conversation
Reduce the size of the leaf node by storing a full key pointer and prefix start/end offsets in every node. This shrinks `leaf[T]` from 64 bytes to 48 bytes while the header struct size remains the same. With room in the padding also cache prefix length (up to 256 bytes) and the node key. Benchmarks versus a74dbdc: linux/arm64, Go 1.25.10, cpu=1, benchtime=200ms, count=10. Benchstat results; RandomReplace updates 1000 objects per operation: old B/op new B/op change WriteTxn_1 632 600 -5.06% WriteTxn_100_SecondaryIndex 419 371 -11.46% RandomReplace 422.2Ki 375.2Ki -11.14% PrefixMerge 432 288 -33.33% PrefixMerge allocations: 7 -> 6 per operation. Write and merge timings are statistically unchanged in these runs. Interleaved lookup benchmarks show the read-path tradeoff: old sec/op new sec/op change RandomLookup 30.07us 30.79us +2.39% SequentialLookup 22.21us 23.11us +4.06% reconciler/benchmark versus a74dbdc, same platform and Go version: GOMAXPROCS=6, -quiet -objects=1000000 -batchsize=1000 -incrbatchsize=1000, ten runs each with alternating execution order. Medians (memory rounded down to MiB by the benchmark): old new change Throughput (objects/sec) 779.6k 789.9k ~ (p=0.280) Total allocated (MiB) 506 445 -12.06% Live heap after GC (MiB) 231 200 -13.42% AIL:3 Signed-off-by: Jussi Maki <jussi@isovalent.com>
|
This comment was marked as low quality.
This comment was marked as low quality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reduce the size of the leaf node by storing a full key pointer and prefix start/end offsets in every node. This shrinks
leaf[T]from 64 bytes to 48 bytes while the header struct size remains the same.With room in the padding also cache prefix length (up to 256 bytes) and the node key.
Benchmarks versus a74dbdc: linux/arm64, Go 1.25.10, cpu=1, benchtime=200ms, count=10. Benchstat results; RandomReplace updates 1000 objects per operation:
PrefixMerge allocations: 7 -> 6 per operation. Write and merge timings are statistically unchanged in these runs.
Interleaved lookup benchmarks show the read-path tradeoff:
reconciler/benchmark versus a74dbdc, same platform and Go version: GOMAXPROCS=6, -quiet -objects=1000000 -batchsize=1000 -incrbatchsize=1000, ten runs each with alternating execution order. Medians (memory rounded down to MiB by the benchmark):
pkg/loadbalancer/benchmarkfromcilium/cilium:AIL:3