Repository navigation
part: Transaction improvements - #208
Merged
Merged
Conversation
|
bimmlerd
approved these changes
Oct 13, 2026
bimmlerd
left a comment
Member
There was a problem hiding this comment.
generally looks fine, the last commit is a bit too much on the complexity side of complexity for speed side IMO
Leaves have no transaction ID and always report zero. Never treat them as writable through the transaction ID shortcut, including in the first transaction, so overwriting a leaf closes its previous watch. AIL:3 Signed-off-by: Jussi Maki <jussi@isovalent.com>
Keep the grown parent-path slice after deep deletions so later deletes
reuse it. Clear visited entries on all return paths to avoid retaining
removed nodes through the transaction cache.
BenchmarkDeleteParentCache repeatedly deletes and reinserts the deepest
key among 8 or 100 nested prefixes in one transaction. Results from
linux/arm64, Go 1.25.10, benchtime=200ms, count=10:
│ old │ new │ vs base
│ sec/op │ sec/op │
depth_8 │ 168.9ns ± 7% │ 171.6ns ± 3% │ ~ (p=0.353 n=10)
depth_100 │ 2.179µs ± 3% │ 1.502µs ± 3% │ -31.08% (p=0.000 n=10)
│ old │ new │ vs base
│ B/op │ B/op │
depth_8 │ 48.00 ± 0% │ 48.00 ± 0% │ ~ (p=1.000 n=10)
depth_100 │ 3504.00 ± 0% │ 48.00 ± 0% │ -98.63% (p=0.000 n=10)
│ old │ new │ vs base
│ allocs/op │ allocs/op │
depth_8 │ 1.000 ± 0% │ 1.000 ± 0% │ ~ (p=1.000 n=10)
depth_100 │ 3.000 ± 0% │ 1.000 ± 0% │ -66.67% (p=0.000 n=10)
AIL:3
Signed-off-by: Jussi Maki <jussi@isovalent.com>
A new transaction need not allocate the parent-path buffer until it
deletes from a nonempty tree. Keep insertion-only transactions free of
this allocation.
BenchmarkFreshWriteTxn creates a new tree, inserts one key, and commits
on each iteration. Results from linux/arm64, Go 1.25.10,
benchtime=200ms, count=10:
│ old │ new │ vs base
│ sec/op │ sec/op │
FreshWriteTxn │ 328.9ns ± 22% │ 135.0ns ± 9% │ -58.96% (p=0.000 n=10)
│ old │ new │ vs base
│ B/op │ B/op │
FreshWriteTxn │ 697.0 ± 0% │ 185.0 ± 0% │ -73.46% (p=0.000 n=10)
│ old │ new │ vs base
│ allocs/op │ allocs/op │
FreshWriteTxn │ 7.000 ± 0% │ 6.000 ± 0% │ -14.29% (p=0.000 n=10)
AIL:3
Signed-off-by: Jussi Maki <jussi@isovalent.com>
joamaki
force-pushed
the
pr/joamaki/part-txn-fixes
branch
from
October 13, 2026 14:11
2712090 to
be53dfc
Compare
Contributor
Author
mmm yeah, I think the idea is still worth doing. I dropped the commit and will take another look at whether this can be done in a much simpler way. |
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.
leaf.txnID()returning 0 leading to thinking that a leaf node doesn't need to be cloned. This could've caused a leaf watch channel to not close when the first transaction inserted the same key twice.newTxnAIL:3