index.js
function (_data, cb) {
      if(!db.data) return cb(new Error('kiddb not open'))
      if(!writing) return db._update(_data, cb)
      db.__data = _data
      qcb.push(cb)
      onWrote = function () {
        onWrote = null
        var cbs = qcb; qcb = []
        var _data = db.__data
        db.__data = null
        db.update(_data, function (err) {
          cbs.forEach(function (cb) {
            cb(err)
          })
        })
      }
    }
function (_data, cb) {
      if(!db.data) return cb(new Error('kiddb not open'))
      if(!writing) return db._update(_data, cb)
      db.__data = _data
      qcb.push(cb)
      onWrote = function () {
        onWrote = null
        var cbs = qcb; qcb = []
        var _data = db.__data
        db.__data = null
        db.update(_data, function (err) {
          cbs.forEach(function (cb) {
            cb(err)
          })
        })
      }
    }
function ( _data , cb ) { if ( ! db . data ) return cb ( new Error ( 'kiddb not open' ) ) if ( ! writing ) return db . _update ( _data , cb ) db . __data = _data qcb . push ( cb ) onWrote = function ( ) { onWrote = null var cbs = qcb ; qcb = [ ] var _data = db . __data db . __data = null db . update ( _data , function ( err ) { cbs . forEach ( function ( cb ) { cb ( err ) } ) } ) } }
instead of doing a concurrent write, queue the new writes. these can probably be merged together, and then a bunch will succeed at once. if you contrived your benchmark the right way, this could look like really great performance!
instead of doing a concurrent write queue the new writes . these can probably be merged together and then a bunch will succeed at once . if you contrived your benchmark the right way this could look like really great performance!