Closed cktang88 closed 3 years ago
Hi! These two projects appeared at roughly the same time (Aloe was a bit earlier), and are not related to each other.
The main differences I noticed at the moment:
--unstable
flag. AloeDb doesn't.mongobj
for it.import { Database } from 'https://deno.land/x/aloedb/mod.ts';
const db = new Database({ path: 'test.json' });
console.time('aloedb-insert');
for (let i = 0; i < 1000; i++) await db.insertOne({ foo: i });
console.timeEnd('aloedb-insert');
console.time('aloedb-find');
for (let i = 0; i < 1000; i++) await db.findOne({ foo: i });
console.timeEnd('aloedb-find');
import Datastore from 'https://deno.land/x/dndb@0.3.3/mod.ts'
const db = new Datastore({ filename: 'database.db', autoload: true })
console.time('dndb-insert');
for (let i = 0; i < 1000; i++) await db.insert({ foo: i });
console.timeEnd('dndb-insert');
console.time('dndb-find');
for (let i = 0; i < 1000; i++) await db.findOne({ foo: i });
console.timeEnd('dndb-find');
> aloedb-insert: 87ms
> aloedb-find: 13ms
> dndb-insert: 568ms
> dndb-find: 7027ms
Thanks for the detailed answer!
https://github.com/denyncrawford/dndb