ssbc / ssb-db2

A new database for secure-scuttlebutt
47 stars 8 forks source link

Use bipf.seekKey2, a tiny bit faster #341

Closed arj03 closed 2 years ago

arj03 commented 2 years ago

Similar to https://github.com/ssb-ngi-pointer/jitdb/pull/218

github-actions[bot] commented 2 years ago

Benchmark results

Part Duration
add 1000 elements 511ms
add 1000 private box1 elements 1156ms
unbox 1000 private box1 elements first run 123ms
unbox 1000 private box1 elements second run 88ms
add 1000 private box1 elements 1143ms
query 1000 elements first run 32ms
query 1000 elements second run 20ms
add 1000 private box2 elements 642ms
unbox 1000 private box2 elements first run 329ms
unbox 1000 private box2 elements second run 318ms
Migrate (+db1) 11128ms
Migrate (alone) 3646ms
Migrate (+db1 +db2) 7515ms
Migrate (+db2) 6001ms
Migrate continuation (+db2) 857ms
Memory usage without indexes 745.71 MB = 26.98 MB + etc
Initial indexing 561ms
Initial indexing maxCpu=86 3833ms
Initial indexing compat 751ms
Two indexes updating concurrently 781ms
key one initial 45ms
key two 1ms
key one again 2ms
reboot and key one again 45ms
latest root posts 560ms
latest posts 8ms
votes one initial 435ms
votes again 0ms
hasRoot 306ms
hasRoot again 0ms
author one posts 243ms
author two posts 17ms
dedicated author one posts 266ms
dedicated author one posts again 1ms
Maximum memory usage 822.46 MB = 50.59 MB + etc
Indexes folder size 9.97mb
github-actions[bot] commented 2 years ago

Benchmark results

Part Duration
add 1000 elements 490ms
add 1000 private box1 elements 1339ms
unbox 1000 private box1 elements first run 148ms
unbox 1000 private box1 elements second run 105ms
add 1000 private box1 elements 1310ms
query 1000 elements first run 42ms
query 1000 elements second run 15ms
add 1000 private box2 elements 777ms
unbox 1000 private box2 elements first run 431ms
unbox 1000 private box2 elements second run 426ms
Migrate (+db1) 14430ms
Migrate (alone) 4768ms
Migrate (+db1 +db2) 10494ms
Migrate (+db2) 7120ms
Migrate continuation (+db2) 1349ms
Memory usage without indexes 726.68 MB = 30.81 MB + etc
Initial indexing 654ms
Initial indexing maxCpu=86 3632ms
Initial indexing compat 886ms
Two indexes updating concurrently 985ms
key one initial 57ms
key two 2ms
key one again 1ms
reboot and key one again 58ms
latest root posts 636ms
latest posts 10ms
votes one initial 544ms
votes again 0ms
hasRoot 381ms
hasRoot again 1ms
author one posts 336ms
author two posts 17ms
dedicated author one posts 370ms
dedicated author one posts again 1ms
Maximum memory usage 791.49 MB = 51.38 MB + etc
Indexes folder size 9.97mb