Use the rsc implementation of the patricia trie#126
Merged
Conversation
26bf979 to
f62fdd7
Compare
This required changing the API structs. We have tagged a v0.1.0 that operators of the old code should pin to. This implementation has comparable disk and memory implementations: ``` go test -bench=BenchmarkBuild -benchmem ./vindex goos: linux goarch: amd64 pkg: github.com/transparency-dev/incubator/vindex cpu: AMD EPYC 7B12 BenchmarkBuild_InMemory-24 1 1006305591 ns/op 13464448 B/op 244751 allocs/op BenchmarkBuild_OnDisk-24 1 1001417280 ns/op 14245768 B/op 261960 allocs/op PASS ok github.com/transparency-dev/incubator/vindex 22.217s ``` Compared with old implementation: ``` New: BenchmarkBuild_InMemory-24 1 1006305591 ns/op 13464448 B/op 244751 allocs/op Old: BenchmarkBuild_InMemory-24 1 1004559670 ns/op 38192304 B/op 588597 allocs/op New: BenchmarkBuild_OnDisk-24 1 1001417280 ns/op 14245768 B/op 261960 allocs/op Old: BenchmarkBuild_OnDisk-24 1 4810209571 ns/op 2268211632 B/op 1541229 allocs/op ``` Given that the disk performance is now so good, and superior for restarts, the vindex implementations have been changed to use persistence by default (though support a flag override to use the memory version). Comparing real world performance of this vs the previous version is most useful. For a full read of SumDB: ``` OUTPUT_LOG_PRIVATE_KEY= go run ./vindex/cmd/sumdbindex --storage_dir 280.92s user 131.52s system 176% cpu 3:54.03 total OUTPUT_LOG_PRIVATE_KEY= go run ./vindex/cmd/sumdbindex --storage_dir 164.35s user 105.55s system 147% cpu 3:03.23 total OUTPUT_LOG_PRIVATE_KEY= go run ./vindex/cmd/sumdbindex --storage_dir 320.98s user 134.93s system 180% cpu 4:13.08 total ```
AlCutter
approved these changes
May 20, 2026
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.
This required changing the API structs. We have tagged a v0.1.0 that
operators of the old code should pin to.
This implementation has comparable disk and memory implementations:
Compared with old implementation:
Given that the disk performance is now so good, and superior for
restarts, the vindex implementations have been changed to use
persistence by default (though support a flag override to use the
memory version).
Comparing real world performance of this vs the previous version is most
useful. For a full read of SumDB: