-
Notifications
You must be signed in to change notification settings - Fork 2
lpm: Use txnID for detecting node mutability and fix compression bug #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
|
6540fd5 to
3b3c221
Compare
3b3c221 to
31a3853
Compare
31a3853 to
2624227
Compare
bimmlerd
approved these changes
Jan 15, 2026
Member
bimmlerd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
pippolo84
approved these changes
Jan 15, 2026
Dedup the insert benchmark. Add delete, lookup, all, prefix and lowerbound benchmarks. Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
The final root wasn't checked whether it become an imaginary single child node which can be then removed completely. Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
Similar to previous commit that implemented this for 'part', implement the same change from 'nodeMutated' to holding a 'txnID' inside each LPM node. Benchmark before: Benchmark_txn_insert/batchSize=1-8 1339 849781 ns/op 1176773 objects/sec 3094433 B/op 13975 allocs/op Benchmark_txn_insert/batchSize=10-8 3534 326227 ns/op 3065346 objects/sec 610990 B/op 6671 allocs/op Benchmark_txn_insert/batchSize=100-8 4123 293279 ns/op 3409722 objects/sec 370742 B/op 6068 allocs/op Benchmark_txn_delete/batchSize=1-8 1212 954251 ns/op 1047943 objects/sec 3542515 B/op 13976 allocs/op Benchmark_txn_delete/batchSize=10-8 3284 351354 ns/op 2846131 objects/sec 598123 B/op 5770 allocs/op Benchmark_txn_delete/batchSize=100-8 3901 298353 ns/op 3351731 objects/sec 310827 B/op 5061 allocs/op Benchmark_LPM_Lookup-8 10000 112214 ns/op 8911511 objects/sec 0 B/op 0 allocs/op Benchmark_LPM_All-8 168121 7029 ns/op 142269460 objects/sec 32 B/op 1 allocs/op Benchmark_LPM_Prefix-8 174777 6902 ns/op 144883606 objects/sec 32 B/op 1 allocs/op Benchmark_LPM_LowerBound-8 374746 3264 ns/op 153166999 objects/sec 288 B/op 2 allocs/op after: Benchmark_txn_insert/batchSize=1-8 2746 432946 ns/op 2309755 objects/sec 838440 B/op 13975 allocs/op Benchmark_txn_insert/batchSize=10-8 4345 276700 ns/op 3614016 objects/sec 385206 B/op 6668 allocs/op Benchmark_txn_insert/batchSize=100-8 4484 263860 ns/op 3789882 objects/sec 345622 B/op 6027 allocs/op Benchmark_txn_delete/batchSize=1-8 2011 572303 ns/op 1747327 objects/sec 1286481 B/op 13976 allocs/op Benchmark_txn_delete/batchSize=10-8 4078 279905 ns/op 3572641 objects/sec 372422 B/op 5769 allocs/op Benchmark_txn_delete/batchSize=100-8 4495 257997 ns/op 3876007 objects/sec 286756 B/op 5038 allocs/op Benchmark_LPM_Lookup-8 10000 110770 ns/op 9027736 objects/sec 0 B/op 0 allocs/op Benchmark_LPM_All-8 184435 6684 ns/op 149605322 objects/sec 32 B/op 1 allocs/op Benchmark_LPM_Prefix-8 189956 6363 ns/op 157162374 objects/sec 32 B/op 1 allocs/op Benchmark_LPM_LowerBound-8 376872 3158 ns/op 158336418 objects/sec 288 B/op 2 allocs/op Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
Add validation code to check lpm trie invariants. There was still a further issue with compression. We were checking the index of the child to decide whether to compress but this wasn't necessary since the prefix was the same. Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
No need to have these separately and "STATEDB_VALIDATE" is less likely to collide with existing environment variables. Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
2624227 to
09d7e02
Compare
bimmlerd
approved these changes
Jan 16, 2026
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.
txnIDfor detecting if a node can be mutated in-place