ssbc / ssb-db2

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

compat/history-stream - add support for { live } #423

Closed mixmix closed 1 year ago

mixmix commented 1 year ago

updating scuttle-testbot and noticed that createHistoryStream({ live: true }) was not supported Added this along with tests

github-actions[bot] commented 1 year ago

Benchmark results

Part Duration
Create 5000 new messages 341.13ms
Validate 5000 messages 456.79ms
Native to db format 5000 messages 98.82ms
Db to native format 5000 messages 88.56ms
Add 1000 elements 491.69ms
Add 1000 box1 msgs 971.92ms
Unbox 1000 box1 msgs first run 191.23ms
Unbox 1000 box1 msgs second run 92.22ms
Add 1000 box1 msgs 932.34ms
Query 1000 msgs first run 41.52ms
Query 1000 msgs second run 11.66ms
Add 1000 box2 msgs 1260.91ms
Unbox 1000 box2 msgs first run 333.72ms
Unbox 1000 box2 msgs second run 163.85ms
Migrate (+db1) 10287.04ms
Migrate (alone) 3175.41ms
Migrate (+db1 +db2) 7429.36ms
Migrate (+db2) 5129.91ms
Migrate continuation (+db2) 905.96ms
Memory usage without indexes 761.50 MB = 43.76 MB + etc
Initial indexing 1422.07ms
Initial indexing maxcpu=86 4464.82ms
Initial indexing compat 536.89ms
Two indexes updating concurrently 2485.71ms
Key one initial 69.09ms
Key two 2.05ms
Key one again 1.07ms
Reboot and key one again 70.79ms
Latest root posts 1504.73ms
Latest posts 8.23ms
Votes one initial 1313.92ms
Votes again 0.33ms
HasRoot 1191.44ms
HasRoot again 0.39ms
Author one posts 1251.07ms
Author two posts 16.28ms
Dedicated author one posts 1229.65ms
Dedicated author one posts again 0.87ms
DeleteFeed 4968.13ms
Maximum memory usage 845.14 MB = 57.34 MB + etc
Indexes folder size 10.01mb
github-actions[bot] commented 1 year ago

Benchmark results

Part Duration
Create 5000 new messages 585.17ms
Validate 5000 messages 577.76ms
Native to db format 5000 messages 160.80ms
Db to native format 5000 messages 139.16ms
Add 1000 elements 395.35ms
Add 1000 box1 msgs 1323.77ms
Unbox 1000 box1 msgs first run 254.76ms
Unbox 1000 box1 msgs second run 134.99ms
Add 1000 box1 msgs 1260.36ms
Query 1000 msgs first run 58.08ms
Query 1000 msgs second run 14.87ms
Add 1000 box2 msgs 2016.44ms
Unbox 1000 box2 msgs first run 504.89ms
Unbox 1000 box2 msgs second run 261.12ms
Migrate (+db1) 16023.85ms
Migrate (alone) 5635.36ms
Migrate (+db1 +db2) 12725.02ms
Migrate (+db2) 8118.59ms
Migrate continuation (+db2) 1608.13ms
Memory usage without indexes 762.04 MB = 40.22 MB + etc
Initial indexing 2023.92ms
Initial indexing maxcpu=86 6274.75ms
Initial indexing compat 1185.89ms
Two indexes updating concurrently 3533.79ms
Key one initial 105.34ms
Key two 1.71ms
Key one again 1.33ms
Reboot and key one again 97.32ms
Latest root posts 2223.31ms
Latest posts 9.87ms
Votes one initial 1801.65ms
Votes again 0.48ms
HasRoot 1551.62ms
HasRoot again 0.38ms
Author one posts 1688.72ms
Author two posts 18.66ms
Dedicated author one posts 1709.44ms
Dedicated author one posts again 0.71ms
DeleteFeed 6994.52ms
Maximum memory usage 845.97 MB = 62.84 MB + etc
Indexes folder size 10.01mb