Performance issue: time spend in rootToLeaf() is growing

19 views
Skip to first unread message

Erez Makavy

unread,
Sep 8, 2016, 9:15:08 PM9/8/16
to PouchDB
Hi,

I am new to pouchDB, I just made a little experiment with many fast updates of a single field in a single document. (about 1000 updates, with 50ms interval),
and I noticed bad performance. 
Chrome dev tools profiler pointed at the rootToLeaf() function, and when I added manual elapsed  time measurement, to the rootToLeaf code, I have noticed that the time grows as I make more updates.
Starting from 0-1 milliseconds for a fresh new document, after 1000 updates the elapsed time is about 80 ms per update.

I am assuming that the history revisions of the document is growing, and this function processes all of them.

It feels to me like a bug...
Is this a bug, or a feature?

Is there a way to bypass it with configuration? or using an in-memory adapter.

My db initialization is:
var localDB = new PouchDB('local_test1');
var remoteDB = new PouchDB('http://localhost:5984/test1');

localDB.sync(remoteDB, {
    live: true
}).on('change', function (change: any) {
    // yo, something changed!
}).on('error', function (err: any) {
    // yo, we got an error! (maybe the user went offline?)
});


I use:
  • pouchDB 5.4.5
    • Used in a React app with typescript, webpack, chrome.
  • couched 1.6.1
  • ektrop to make updates from my java server
  • Mac OSX el capitan

Any ideas?

Thanks,
Erez

Reply all
Reply to author
Forward
0 new messages