indexeddb.get(open_revs): don't re-fetch docs#8801
indexeddb.get(open_revs): don't re-fetch docs#8801alxndrsn wants to merge 5 commits intoapache:masterfrom
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.
| 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.
This function needs to be created.
|
Tests currently failing due to body size limit in |
|
PR to increase body-parser size limits in |
|
Tests are hitting request size limits in |
garethbowen
left a comment
There was a problem hiding this comment.
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.
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.
IIRC it mostly came from adapter.js in pouchd-core. You're right that there's probably more code that could be shared.
| var PullRequestTestObject = function () {}; | ||
|
|
||
| PullRequestTestObject.prototype.setup = function (itr, gens) { | ||
| PullRequestTestObject.prototype.setup = function ({ itr, gens, openRevs=1, reverse=false }) { |
There was a problem hiding this comment.
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
indexeddbadapter 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: