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
indexeddb.get(open_revs): don't re-fetch docs #8801
base: master
Are you sure you want to change the base?
Conversation
This significantly improves performance when replicating a local PouchDB with conflicted docs. However, it may not be a common-enough scenario to deserve the extra complexity.
@@ -555,6 +556,7 @@ class AbstractPouchDB extends EventEmitter { | |||
for (var i = 0; i < leaves.length; i++) { | |||
var l = leaves[i]; | |||
// looks like it's the only thing couchdb checks | |||
// TODO replace with !isValidRev(l); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function needs to be created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now exists...
Tests currently failing due to body size limit in |
PR to increase body-parser size limits in |
Tests are hitting request size limits in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement! The main question is about where the new code came from, which will help me understand the complexity tradeoff.
|
||
processAttachments(api, metadata, doc, opts, ctx, cb); | ||
}); | ||
}).bind(api); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look like code you would write... is it copied from somewhere? If so, can it be reused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC it mostly came from adapter.js
in pouchd-core
. You're right that there's probably more code that could be shared.
|
||
PullRequestTestObject.prototype.setup = function (itr, gens) { | ||
PullRequestTestObject.prototype.setup = function ({ itr, gens, openRevs=1, reverse=false }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverse
is ambiguous... initially I thought this was referring to descending
. What about source="remote"
or similar?
@alxndrsn This seems fairly close to being done - is it easy enough to get it back into review? |
This significantly improves performance when replicating from a PouchDB using
indexeddb
adapter with conflicted docs.However, it may not be a common-enough scenario to deserve the extra complexity.
New perf test cases are included to demonstrate the improved performance. Existing test cases do not show significant change.
Example perf test runs: