ssbc / ssb-db2

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

fix annoying encryptionFormat bug #397

Closed mixmix closed 1 year ago

mixmix commented 1 year ago

I want to be able to just use box2, but when i took out box1 all my tests for encrypted messages were complaining.

This inversion fixes it - i.e. only be fretting about encryptionFormat being present or not IF I'm possibly trying to encrrypt

github-actions[bot] commented 1 year ago

Benchmark results

Part Duration
Create 5000 new messages 398.99ms
Validate 5000 messages 469.45ms
Native to db format 5000 messages 120.54ms
Db to native format 5000 messages 88.89ms
Add 1000 elements 364.75ms
Add 1000 box1 msgs 939.74ms
Unbox 1000 box1 msgs first run 213.03ms
Unbox 1000 box1 msgs second run 104.78ms
Add 1000 box1 msgs 895.38ms
Query 1000 msgs first run 34.12ms
Query 1000 msgs second run 30.03ms
Add 1000 box2 msgs 1280.14ms
Unbox 1000 box2 msgs first run 342.65ms
Unbox 1000 box2 msgs second run 157.93ms
Migrate (+db1) 11629.94ms
Migrate (alone) 4003.15ms
Migrate (+db1 +db2) 8358.89ms
Migrate (+db2) 6223.54ms
Migrate continuation (+db2) 960.90ms
Memory usage without indexes 740.70 MB = 42.37 MB + etc
Initial indexing 1662.43ms
Initial indexing maxcpu=86 5344.51ms
Initial indexing compat 815.20ms
Two indexes updating concurrently 2965.24ms
Key one initial 52.80ms
Key two 0.82ms
Key one again 1.45ms
Reboot and key one again 49.40ms
Latest root posts 1877.61ms
Latest posts 9.59ms
Votes one initial 1568.26ms
Votes again 0.67ms
HasRoot 1336.21ms
HasRoot again 0.32ms
Author one posts 1400.79ms
Author two posts 28.01ms
Dedicated author one posts 1450.49ms
Dedicated author one posts again 0.59ms
DeleteFeed 2984.42ms
Maximum memory usage 1006.47 MB = 58.50 MB + etc
Indexes folder size 10.01mb
github-actions[bot] commented 1 year ago

Benchmark results

Part Duration
Create 5000 new messages 356.96ms
Validate 5000 messages 453.65ms
Native to db format 5000 messages 114.53ms
Db to native format 5000 messages 92.91ms
Add 1000 elements 488.60ms
Add 1000 box1 msgs 939.07ms
Unbox 1000 box1 msgs first run 212.05ms
Unbox 1000 box1 msgs second run 106.71ms
Add 1000 box1 msgs 896.92ms
Query 1000 msgs first run 43.84ms
Query 1000 msgs second run 12.67ms
Add 1000 box2 msgs 1280.88ms
Unbox 1000 box2 msgs first run 351.00ms
Unbox 1000 box2 msgs second run 176.88ms
Migrate (+db1) 11208.97ms
Migrate (alone) 3900.78ms
Migrate (+db1 +db2) 8050.42ms
Migrate (+db2) 6101.65ms
Migrate continuation (+db2) 835.18ms
Memory usage without indexes 746.14 MB = 36.79 MB + etc
Initial indexing 1605.31ms
Initial indexing maxcpu=86 5264.75ms
Initial indexing compat 724.41ms
Two indexes updating concurrently 2747.35ms
Key one initial 57.39ms
Key two 1.41ms
Key one again 0.98ms
Reboot and key one again 42.44ms
Latest root posts 1726.40ms
Latest posts 8.69ms
Votes one initial 1440.99ms
Votes again 0.58ms
HasRoot 1273.86ms
HasRoot again 0.28ms
Author one posts 1384.53ms
Author two posts 16.50ms
Dedicated author one posts 1430.37ms
Dedicated author one posts again 0.47ms
DeleteFeed 2798.70ms
Maximum memory usage 933.94 MB = 63.22 MB + etc
Indexes folder size 10.01mb