ssbc / ssb-db2

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

Adding ooo messages should not update base index #412

Closed arj03 closed 1 year ago

arj03 commented 1 year ago

This should fix #395. The base index is both used for EBT & validation so doesn't make sense to update for ooo messages.

github-actions[bot] commented 1 year ago

Benchmark results

Part Duration
Create 5000 new messages 358.57ms
Validate 5000 messages 445.35ms
Native to db format 5000 messages 113.94ms
Db to native format 5000 messages 84.06ms
Add 1000 elements 365.66ms
Add 1000 box1 msgs 922.38ms
Unbox 1000 box1 msgs first run 210.94ms
Unbox 1000 box1 msgs second run 105.58ms
Add 1000 box1 msgs 887.25ms
Query 1000 msgs first run 33.37ms
Query 1000 msgs second run 22.12ms
Add 1000 box2 msgs 1250.98ms
Unbox 1000 box2 msgs first run 291.36ms
Unbox 1000 box2 msgs second run 153.97ms
Migrate (+db1) 11470.85ms
Migrate (alone) 3962.57ms
Migrate (+db1 +db2) 8239.78ms
Migrate (+db2) 6288.77ms
Migrate continuation (+db2) 940.98ms
Memory usage without indexes 749.89 MB = 39.26 MB + etc
Initial indexing 1595.99ms
Initial indexing maxcpu=86 4954.96ms
Initial indexing compat 713.43ms
Two indexes updating concurrently 2833.64ms
Key one initial 46.54ms
Key two 1.97ms
Key one again 0.84ms
Reboot and key one again 43.76ms
Latest root posts 1742.60ms
Latest posts 9.76ms
Votes one initial 1462.38ms
Votes again 0.55ms
HasRoot 1271.51ms
HasRoot again 0.30ms
Author one posts 1362.38ms
Author two posts 18.43ms
Dedicated author one posts 1429.11ms
Dedicated author one posts again 0.51ms
DeleteFeed 5754.04ms
Maximum memory usage 972.36 MB = 57.35 MB + etc
Indexes folder size 10.01mb
github-actions[bot] commented 1 year ago

Benchmark results

Part Duration
Create 5000 new messages 401.04ms
Validate 5000 messages 488.18ms
Native to db format 5000 messages 111.94ms
Db to native format 5000 messages 88.28ms
Add 1000 elements 493.21ms
Add 1000 box1 msgs 1004.57ms
Unbox 1000 box1 msgs first run 217.80ms
Unbox 1000 box1 msgs second run 102.85ms
Add 1000 box1 msgs 968.20ms
Query 1000 msgs first run 42.95ms
Query 1000 msgs second run 20.59ms
Add 1000 box2 msgs 1292.35ms
Unbox 1000 box2 msgs first run 309.67ms
Unbox 1000 box2 msgs second run 155.42ms
Migrate (+db1) 11106.91ms
Migrate (alone) 3735.87ms
Migrate (+db1 +db2) 8263.09ms
Migrate (+db2) 5756.18ms
Migrate continuation (+db2) 899.60ms
Memory usage without indexes 751.71 MB = 41.19 MB + etc
Initial indexing 1598.20ms
Initial indexing maxcpu=86 4695.09ms
Initial indexing compat 656.10ms
Two indexes updating concurrently 2817.46ms
Key one initial 47.56ms
Key two 1.34ms
Key one again 4.39ms
Reboot and key one again 48.89ms
Latest root posts 1718.52ms
Latest posts 9.32ms
Votes one initial 1466.31ms
Votes again 0.49ms
HasRoot 1295.23ms
HasRoot again 0.32ms
Author one posts 1398.61ms
Author two posts 21.97ms
Dedicated author one posts 1419.81ms
Dedicated author one posts again 0.75ms
DeleteFeed 5090.49ms
Maximum memory usage 995.76 MB = 58.98 MB + etc
Indexes folder size 10.01mb