GithubHelp home page GithubHelp logo

firatkiral / controldb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from techfort/lokijs

5.0 5.0 0.0 8.27 MB

javascript embeddable / in-memory database

Home Page: https://firatkiral.github.io/controldb/

License: MIT License

JavaScript 100.00%

controldb's Introduction

Projects:

KodiBot - Open source local AI chat assistant app for Desktop

PyPeek - Open source screen capture and recording tool with annotations

collobox.com - File sharing and collaboration platform

instantrig.com - 3D auto rigging script for 3DS Max

spacedrop.app - Peer-to-peer file and text exchanging web application

pysketch.com - Online python editor for creative coding in HTML5

ControlDB - Javascript document oriented database (Fork of LokiJS).

instantui.com - Lightweight JavaScript UI widgets (wip)

deform3d.com - Online 3d editor (wip)

controldb's People

Contributors

alex-werner avatar alexandernst avatar alinanova21 avatar areksredzki avatar assafweinberg avatar bnadim avatar christophertaplogic avatar cortys avatar firatkiral avatar goatslacker avatar guewen avatar johnmunsch avatar jonathanz avatar kavaro avatar kberryman avatar lagden avatar moocar avatar moshewe avatar mromanbcn avatar obeliskos avatar plepe avatar radex avatar redsandro avatar stefalda avatar stefanprobst avatar techfort avatar thrilleratplay avatar viatorus avatar vladimirtechman avatar xbenjii avatar

Stargazers

 avatar

controldb's Issues

Map/bucket index

I'm doing searches on a field that is mostly (but not strictly) unique, and I'm trying to find a way to do map/bucket-based search shortcuts for some searches that now happen with binary indexes. Is this something that would be interesting for controldb? Given this content of mock.json, I'm getting a an order of magnitude speedup for searches even with fairly large buckets.

var Benchmark = require('benchmark');
const controldb = require('controldb')

const items = require('./mock.json')

const map = new Map
for (const item of items) {
  if (Math.random() > 0.05) item.firstname = '29686947-c999-456b-b15e-1710114088f2'
  map.set(item.firstname, [ ...(map.get(item.firstname) || []), item ])
}

const DB = new controldb('better-bibtex', {})
const coll = DB.addCollection('x', {
  indices: [ 'id', 'firstname' ],
  unique: [ 'id' ],
})
coll.insert(items)

var suite = new Benchmark.Suite;

suite
  .add('controldb', function() {
    if (coll.find({ $and: [ { firstname: '29686947-c999-456b-b15e-1710114088f2' }, { id: 15000 } ] }).docs().length  !== 1) throw new Error('failed')
  })
  .add('map', function() {
    if (map.get('29686947-c999-456b-b15e-1710114088f2').filter(item => item.id === 15000).length !== 1) throw new Error('failed')
  })
  .on('cycle', function(event) { console.log(String(event.target)) })
  .on('complete', function() {
    console.log('Fastest is ' + this.filter('fastest').map('name'));
  })
  .run({ async: false });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.