ssbc / ssb-db2

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

reindex jitdb in reset() #387

Closed staltz closed 2 years ago

staltz commented 2 years ago

This is so small and simple, that I doubted if I should ask for a review.

github-actions[bot] commented 2 years ago

Benchmark results

Part Duration
Create 5000 new messages 523.69ms
Validate 5000 messages 553.20ms
Native to db format 5000 messages 150.29ms
Db to native format 5000 messages 114.06ms
Add 1000 elements 382.45ms
Add 1000 box1 msgs 1107.14ms
Unbox 1000 box1 msgs first run 302.04ms
Unbox 1000 box1 msgs second run 153.17ms
Add 1000 box1 msgs 1172.06ms
Query 1000 msgs first run 68.05ms
Query 1000 msgs second run 17.42ms
Add 1000 box2 msgs 1829.80ms
Unbox 1000 box2 msgs first run 469.46ms
Unbox 1000 box2 msgs second run 225.69ms
Migrate (+db1) 15477.50ms
Migrate (alone) 5710.08ms
Migrate (+db1 +db2) 12581.70ms
Migrate (+db2) 8083.04ms
Migrate continuation (+db2) 1348.70ms
Memory usage without indexes 743.82 MB = 39.74 MB + etc
Initial indexing 2209.72ms
Initial indexing maxcpu=86 6308.15ms
Initial indexing compat 1139.98ms
Two indexes updating concurrently 3681.68ms
Key one initial 60.94ms
Key two 1.33ms
Key one again 1.27ms
Reboot and key one again 49.30ms
Latest root posts 2259.42ms
Latest posts 9.42ms
Votes one initial 1785.15ms
Votes again 0.35ms
HasRoot 1591.47ms
HasRoot again 0.36ms
Author one posts 1753.45ms
Author two posts 26.51ms
Dedicated author one posts 1710.98ms
Dedicated author one posts again 0.74ms
DeleteFeed 3823.85ms
Maximum memory usage 1008.87 MB = 63.88 MB + etc
Indexes folder size 10.01mb
github-actions[bot] commented 2 years ago

Benchmark results

Part Duration
Create 5000 new messages 396.58ms
Validate 5000 messages 466.88ms
Native to db format 5000 messages 110.00ms
Db to native format 5000 messages 86.71ms
Add 1000 elements 483.87ms
Add 1000 box1 msgs 957.92ms
Unbox 1000 box1 msgs first run 227.72ms
Unbox 1000 box1 msgs second run 121.49ms
Add 1000 box1 msgs 914.13ms
Query 1000 msgs first run 58.57ms
Query 1000 msgs second run 14.19ms
Add 1000 box2 msgs 1443.53ms
Unbox 1000 box2 msgs first run 405.87ms
Unbox 1000 box2 msgs second run 184.36ms
Migrate (+db1) 13879.64ms
Migrate (alone) 4822.26ms
Migrate (+db1 +db2) 9594.04ms
Migrate (+db2) 6944.83ms
Migrate continuation (+db2) 1040.07ms
Memory usage without indexes 753.04 MB = 36.17 MB + etc
Initial indexing 1711.93ms
Initial indexing maxcpu=86 5420.15ms
Initial indexing compat 917.22ms
Two indexes updating concurrently 2890.90ms
Key one initial 42.63ms
Key two 3.63ms
Key one again 1.03ms
Reboot and key one again 43.63ms
Latest root posts 1824.63ms
Latest posts 8.69ms
Votes one initial 1570.02ms
Votes again 0.65ms
HasRoot 1339.48ms
HasRoot again 0.30ms
Author one posts 1438.14ms
Author two posts 22.57ms
Dedicated author one posts 1491.44ms
Dedicated author one posts again 0.56ms
DeleteFeed 3219.46ms
Maximum memory usage 933.50 MB = 58.26 MB + etc
Indexes folder size 10.01mb