ssbc / ssb-db2

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

replace clarify-error with new Error cause #418

Closed staltz closed 1 year ago

staltz commented 1 year ago

Note! This makes ssb-db2 incompatible with any version of Node.js smaller than 16.x

I suppose we should mark this as a breaking change.

github-actions[bot] commented 1 year ago

Benchmark results

Part Duration
Create 5000 new messages 605.29ms
Validate 5000 messages 566.03ms
Native to db format 5000 messages 171.06ms
Db to native format 5000 messages 127.37ms
Add 1000 elements 518.64ms
Add 1000 box1 msgs 1364.47ms
Unbox 1000 box1 msgs first run 292.05ms
Unbox 1000 box1 msgs second run 150.93ms
Add 1000 box1 msgs 1339.23ms
Query 1000 msgs first run 56.82ms
Query 1000 msgs second run 16.02ms
Add 1000 box2 msgs 1999.30ms
Unbox 1000 box2 msgs first run 485.14ms
Unbox 1000 box2 msgs second run 246.58ms
Migrate (+db1) 16627.14ms
Migrate (alone) 5764.81ms
Migrate (+db1 +db2) 12632.50ms
Migrate (+db2) 8359.97ms
Migrate continuation (+db2) 1294.95ms
Memory usage without indexes 777.32 MB = 42.65 MB + etc
Initial indexing 2154.68ms
Initial indexing maxcpu=86 6538.54ms
Initial indexing compat 1248.48ms
Two indexes updating concurrently 3829.08ms
Key one initial 76.31ms
Key two 1.71ms
Key one again 1.49ms
Reboot and key one again 52.19ms
Latest root posts 2435.47ms
Latest posts 10.12ms
Votes one initial 1929.68ms
Votes again 0.93ms
HasRoot 1780.47ms
HasRoot again 0.36ms
Author one posts 1799.32ms
Author two posts 23.11ms
Dedicated author one posts 1869.21ms
Dedicated author one posts again 0.72ms
DeleteFeed 6679.26ms
Maximum memory usage 937.27 MB = 63.51 MB + etc
Indexes folder size 10.01mb
arj03 commented 1 year ago

There is s mention in the readme as well:

Requires Node.js 12 or higher

I guess we didn't need ssb-threads in the tests?

staltz commented 1 year ago

Yeah ssb-threads and ssb-friends were used in the benchmarks, but those are test.skiped benchmarks. I think we know what to do later if we want to enable those benchmarks, but I wanted to get rid of the chicken-and-egg with ssb-threads bringing its own old version of ssb-db2.

Will update the README

github-actions[bot] commented 1 year ago

Benchmark results

Part Duration
Create 5000 new messages 363.60ms
Validate 5000 messages 452.97ms
Native to db format 5000 messages 111.48ms
Db to native format 5000 messages 86.80ms
Add 1000 elements 367.21ms
Add 1000 box1 msgs 929.21ms
Unbox 1000 box1 msgs first run 207.02ms
Unbox 1000 box1 msgs second run 96.32ms
Add 1000 box1 msgs 896.18ms
Query 1000 msgs first run 29.43ms
Query 1000 msgs second run 15.91ms
Add 1000 box2 msgs 1267.47ms
Unbox 1000 box2 msgs first run 289.00ms
Unbox 1000 box2 msgs second run 133.26ms
Migrate (+db1) 11182.93ms
Migrate (alone) 3760.61ms
Migrate (+db1 +db2) 8094.59ms
Migrate (+db2) 5818.25ms
Migrate continuation (+db2) 880.50ms
Memory usage without indexes 745.00 MB = 37.60 MB + etc
Initial indexing 1538.83ms
Initial indexing maxcpu=86 4898.11ms
Initial indexing compat 704.91ms
Two indexes updating concurrently 3006.45ms
Key one initial 47.70ms
Key two 0.60ms
Key one again 0.27ms
Reboot and key one again 41.65ms
Latest root posts 1704.42ms
Latest posts 11.56ms
Votes one initial 1414.64ms
Votes again 0.61ms
HasRoot 1269.58ms
HasRoot again 0.30ms
Author one posts 1364.19ms
Author two posts 15.65ms
Dedicated author one posts 1371.39ms
Dedicated author one posts again 0.61ms
DeleteFeed 5433.42ms
Maximum memory usage 975.90 MB = 61.31 MB + etc
Indexes folder size 10.01mb
github-actions[bot] commented 1 year ago

Benchmark results

Part Duration
Create 5000 new messages 355.37ms
Validate 5000 messages 478.68ms
Native to db format 5000 messages 106.86ms
Db to native format 5000 messages 81.07ms
Add 1000 elements 495.30ms
Add 1000 box1 msgs 1000.58ms
Unbox 1000 box1 msgs first run 216.38ms
Unbox 1000 box1 msgs second run 101.23ms
Add 1000 box1 msgs 964.64ms
Query 1000 msgs first run 41.54ms
Query 1000 msgs second run 19.74ms
Add 1000 box2 msgs 1274.47ms
Unbox 1000 box2 msgs first run 270.45ms
Unbox 1000 box2 msgs second run 143.89ms
Migrate (+db1) 10875.67ms
Migrate (alone) 3731.86ms
Migrate (+db1 +db2) 8063.26ms
Migrate (+db2) 5698.52ms
Migrate continuation (+db2) 841.63ms
Memory usage without indexes 772.35 MB = 40.03 MB + etc
Initial indexing 1557.32ms
Initial indexing maxcpu=86 4667.91ms
Initial indexing compat 663.79ms
Two indexes updating concurrently 2723.58ms
Key one initial 50.75ms
Key two 2.14ms
Key one again 4.10ms
Reboot and key one again 48.08ms
Latest root posts 1672.23ms
Latest posts 8.76ms
Votes one initial 1445.96ms
Votes again 0.54ms
HasRoot 1399.29ms
HasRoot again 0.31ms
Author one posts 1373.50ms
Author two posts 17.41ms
Dedicated author one posts 1392.92ms
Dedicated author one posts again 0.55ms
DeleteFeed 4918.84ms
Maximum memory usage 1017.08 MB = 60.62 MB + etc
Indexes folder size 10.01mb