-
Notifications
You must be signed in to change notification settings - Fork 0
/
message-store-benchmark-runner.js
36 lines (26 loc) · 1.25 KB
/
message-store-benchmark-runner.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { CozoClosableAdapter, MessageStoreCozo } from 'dwn-cozo-store';
import { runMessageStoreBenchmark } from './message-store-benchmark.js';
async function main() {
const { MessageStoreLevel } = require('@tbd54566975/dwn-sdk-js/dist/esm/src/store/message-store-level.js');
const rocksdb = new CozoClosableAdapter('rocksdb', './rocksdb');
const results = {};
const rocksMessageStore = new MessageStoreCozo(rocksdb);
const rocksResults = await runMessageStoreBenchmark(rocksMessageStore);
results['rocksdb'] = rocksResults;
const mem = new CozoClosableAdapter('mem');
const memMessageStore = new MessageStoreCozo(mem);
const memResults = await runMessageStoreBenchmark(memMessageStore);
results['mem'] = memResults;
const sqliteCozo = new CozoClosableAdapter('sqlite', './test.db');
const sqliteMessageStore = new MessageStoreCozo(sqliteCozo);
const sqliteResults = await runMessageStoreBenchmark(sqliteMessageStore);
results['sqlite'] = sqliteResults;
const messageStore = new MessageStoreLevel({
blockstoreLocation : 'BENCHMARK-BLOCK',
indexLocation : 'BENCHMARK-INDEX',
});
const levelResults = await runMessageStoreBenchmark(messageStore);
results['level'] = levelResults;
console.log(JSON.stringify(results, null, 2));
}
main().catch(console.error);