-
Notifications
You must be signed in to change notification settings - Fork 299
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
#806 Add _conflicts to the document in the map function #822
Conversation
- When updating view index, gather a list of the conflict revisions if any. - Add index conflict docs performance test to View_Benchmarks.
With some possible perf cost, what do you think about overloading setMapBlock method with an option param (having a property to include _conflicts) to setMapBlock so by default the doc will not include _conficts? |
@@ -92,7 +92,10 @@ virtual void addDocument(const Document& cppDoc) { | |||
const Revision* node = vdoc.currentRevision(); | |||
NSMutableDictionary* body = [CBLForestBridge bodyOfNode: node]; | |||
body[@"_local_seq"] = @(node->sequence); | |||
|
|||
NSArray* conflicts = [CBLForestBridge getCurrentRevisionIDs: vdoc]; |
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.
You can wrap this new code with if (vdoc.isConflicted()) { ... }
to remove the overhead for docs without conflicts.
I'm not worried about slowing down view indexing in the case where there are conflicts, since conflicts shouldn't be common. I'm just worried about slowing down indexing for the regular case where there are no conflicts. If you add the change I suggested above, there shouldn't be any noticeable overhead. Could you benchmark with and without your patch to look for a regression? |
Yes, I will do that. |
I made change as suggested. The change now doesn't affect non-conflicts indexing performance. |
Add _conflicts to the document in the map function
** Update : Add Performance result for indexing 5000 docs without conflicts.
#806