Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance PouchDB, with sqldown: very slow #12

Open
jacargentina opened this issue Dec 15, 2014 · 8 comments
Open

Performance PouchDB, with sqldown: very slow #12

jacargentina opened this issue Dec 15, 2014 · 8 comments

Comments

@jacargentina
Copy link

This test takes much time (1 min.) vs using for example medeadown, which takes 1 sec.

var PouchDB = require('pouchdb');

var db = new PouchDB('test', {
  db: require('sqldown')
});

var arr = [];
for (var i = 0; i < 200; i++) {
  arr.push({
    _id: i.toString(),
    value: i
  });
}
console.log('bulk start: ', new Date());
db.bulkDocs(arr)
  .then(function(r) {
    console.log('bulk end: ', new Date());
  });

Moved from pouchdb/pouchdb/issues/3167

@calvinmetcalf
Copy link
Owner

Yeah that seems slow,if been doing some work on it check the upgrade knex
branch

On Mon, Dec 15, 2014, 5:17 AM Javier Castro notifications@github.com
wrote:

This test takes much time (1 min.) vs using for example medeadown, which
takes 1 sec.

var PouchDB = require('pouchdb');
var db = new PouchDB('test', {
db: require('sqldown')
});
var arr = [];for (var i = 0; i < 200; i++) {
arr.push({
_id: i.toString(),
value: i
});
}console.log('bulk start: ', new Date());
db.bulkDocs(arr)
.then(function(r) {
console.log('bulk end: ', new Date());
});

Moved from pouchdb/pouchdb#3167
pouchdb/pouchdb#3167


Reply to this email directly or view it on GitHub
#12.

@calvinmetcalf
Copy link
Owner

unable to confirm, using a slightly modified version of the code

var PouchDB = require('pouchdb');

var db = new PouchDB('testdb', {
  db: require('./')
});

var arr = [];
for (var i = 0; i < 200; i++) {
  arr.push({
    _id: i.toString(),
    value: i
  });
}
console.time('bulk');
db.bulkDocs(arr)
  .then(function() {
    console.timeEnd('bulk');
  });

I get

bulk: 986ms

@jacargentina
Copy link
Author

I'm running that code with this package.json:

{
  "dependencies": {
    "pouchdb": "pouchdb/pouchdb",
    "sqldown": "calvinmetcalf/sqldown#upgrade-knex",
    "sqlite3": "^3.0.4"
  }
}

I get this (on linux):

bulk: 44690ms

@jacargentina
Copy link
Author

The data is there after execute those super-fast 986ms ?

@calvinmetcalf
Copy link
Owner

yes it is, let me try this from a linux box and see what happens (on a mac right now)

@jacargentina
Copy link
Author

Yeah, i've used a Win7 (virtual) box, and a Fedora 21 (hosted) box so far.

@calvinmetcalf
Copy link
Owner

ok tried it on an aws box and got bulk: 13471ms but it is a box with quite a bit running on it so I'll try it at home on my ubuntu laptop when I have a chance, this is likely an issue with the sqlite3 module

@yaronyg
Copy link

yaronyg commented Mar 27, 2015

I wanted to get a sense for the perf difference between SQLDown and LevelDown. So I tried to run the PouchDb perf tests. I couldn't get all-docs-skip-limit to even run and I had to remove the destroy in the test cleanup thanks to #11. But here are some results:

Test Name Node.js w/ LevelDB Node.js w/SQLite Multiplier
basic-inserts 381 45138 118x
bulk-insert 937 18495 20x
basic-gets 702 4380 6x
all-docs-skip-limit 3143 Wouldn't run! NA
all-docs-startkey-endkey 205 680 3x
pull-replication-one-generation 524 2586 5x
pull-replication-two-generation 1731 3611 2x
basic-attachments 2214 50162 23x

The view tests failed with EBUSY when trying to get to test0_x-mrview-temp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants