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
Avoid document body unmarshalling on changes requests #2428
Comments
For the second item ("When bucket retrieval is required, unmarshal only the rev history, not the full doc body.") - in the context of this ticket, this is specifically about the call to db.GetDoc in changes.addDocToChangeEntry. One option would be to add a new db method (like 'GetDocSyncData') that only returns the sync data. Another would be to modify the document struct to always lazy unmarshal the document body. This has the potential for more benefits across the entire codebase, but would require more significant refactoring - it might make more sense to hold that refactoring until 2.0, when the sync data moves to xattrs. |
Notes to self:
Benchmark:
|
Test results
Without fix: 8ef9a00 So it looks like a ~3.5X speedup |
NOTE: it uses the *testing.TB interface just where it needs to, but we should fix this everywhere in a different PR
Currently changes requests that specify style=all_docs have unnecessary performance overhead when retrieving branched documents.
changes.addDocToChangeEntry will retrieve the document from the bucket (to identify the set of leaf revisions). In the process it will unmarshal the entire doc.
Two enhancements:
The text was updated successfully, but these errors were encountered: