ssbc / ssb-db2

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

refactor test with toPromise instead of toPullStream #331

Closed staltz closed 2 years ago

staltz commented 2 years ago

Just refactoring a test to have less lines of code.

arj03 commented 2 years ago

Wait, what is up with the tests on CI?

staltz commented 2 years ago

I'll check

github-actions[bot] commented 2 years ago

Benchmark results

Part Duration
add 1000 elements 509ms
add 1000 private box1 elements 1504ms
unbox 1000 private box1 elements first run 159ms
unbox 1000 private box1 elements second run 126ms
add 1000 private box1 elements 1493ms
query 1000 elements first run 43ms
query 1000 elements second run 24ms
add 1000 private box2 elements 780ms
unbox 1000 private box2 elements first run 466ms
unbox 1000 private box2 elements second run 440ms
Migrate (+db1) 15478ms
Migrate (alone) 5327ms
Migrate (+db1 +db2) 12228ms
Migrate (+db2) 8445ms
Migrate continuation (+db2) 1433ms
Memory usage without indexes 737.16 MB = 31.56 MB + etc
Initial indexing 886ms
Initial indexing maxCpu=86 5173ms
Initial indexing compat 1172ms
Two indexes updating concurrently 951ms
key one initial 62ms
key two 2ms
key one again 2ms
reboot and key one again 60ms
latest root posts 760ms
latest posts 16ms
votes one initial 662ms
votes again 3ms
hasRoot 490ms
hasRoot again 1ms
author one posts 368ms
author two posts 18ms
dedicated author one posts 393ms
dedicated author one posts again 2ms
Maximum memory usage 784.70 MB = 46.25 MB + etc
Indexes folder size 12.76mb
arj03 commented 2 years ago

Wierd

github-actions[bot] commented 2 years ago

Benchmark results

Part Duration
add 1000 elements 495ms
add 1000 private box1 elements 1176ms
unbox 1000 private box1 elements first run 133ms
unbox 1000 private box1 elements second run 101ms
add 1000 private box1 elements 1297ms
query 1000 elements first run 39ms
query 1000 elements second run 18ms
add 1000 private box2 elements 679ms
unbox 1000 private box2 elements first run 367ms
unbox 1000 private box2 elements second run 331ms
Migrate (+db1) 12961ms
Migrate (alone) 4284ms
Migrate (+db1 +db2) 9428ms
Migrate (+db2) 6792ms
Migrate continuation (+db2) 997ms
Memory usage without indexes 756.84 MB = 26.04 MB + etc
Initial indexing 663ms
Initial indexing maxCpu=86 4553ms
Initial indexing compat 949ms
Two indexes updating concurrently 1011ms
key one initial 55ms
key two 3ms
key one again 2ms
reboot and key one again 53ms
latest root posts 709ms
latest posts 17ms
votes one initial 544ms
votes again 1ms
hasRoot 412ms
hasRoot again 2ms
author one posts 299ms
author two posts 17ms
dedicated author one posts 392ms
dedicated author one posts again 1ms
Maximum memory usage 826.20 MB = 50.67 MB + etc
Indexes folder size 12.76mb