You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the rsc implementation of the patricia trie (#126)
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
```
Copy file name to clipboardExpand all lines: vindex/cmd/logandmap/main.go
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,7 @@ var (
53
53
inputLogPrivKeyFile=flag.String("input_log_private_key_path", "", "Location of private key file. If unset, uses the contents of the INPUT_LOG_PRIVATE_KEY environment variable.")
54
54
outputLogPrivKeyFile=flag.String("output_log_private_key_path", "", "Location of private key file. If unset, uses the contents of the OUTPUT_LOG_PRIVATE_KEY environment variable.")
55
55
storageDir=flag.String("storage_dir", "", "Root directory in which to store the data for the demo. This will create subdirectories for the Input Log, Output Log, and allocate space to store the verifiable map persistence.")
56
+
persistIndex=flag.Bool("persist_index", true, "Set to false to use a memory-based implementation of the verifiable index.")
56
57
listen=flag.String("listen", ":8088", "Address to set up HTTP server listening on")
0 commit comments