[ 
https://issues.apache.org/jira/browse/OAK-3578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14989538#comment-14989538
 ] 

Marcel Reutegger commented on OAK-3578:
---------------------------------------

- {{Collision.markCommitRoot()}}: there is no need to check the return document 
in this case. We only need to know if adding the collision marker was possible 
or not. This is a rather infrequent call and only happens when there is a 
conflict.
- {{DocumentNodeStore.merge()}}: the before document is not needed in this 
case. We only need to know if the conditional update was successful or not. 
This call is also infrequent and only happens when a branch is merged. Most 
commits do not create a branch.
- {{DocumentNodeStore.reset()}}: this method is called rarely. First a commit 
must create a branch and the branch must run into a conflict while commit 
editors are running. Changes done by the editors are then reset.

To me it looks like it is not worth the effort to change the API for this kind 
of optimization. We should reconsider when we have a benchmark that shows the 
benefit.

> DocumentStore API: introduce void variant of findAndUpdate
> ----------------------------------------------------------
>
>                 Key: OAK-3578
>                 URL: https://issues.apache.org/jira/browse/OAK-3578
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: documentmk
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>         Attachments: OAK-3578.diff
>
>
> {{findAndUpdate}} returns the previous state of the document (when 
> applicable). However, this information is not always needed by the caller and 
> may be expensive to obtain.
> Thus split the API into two different methods, so that DocumentStore 
> implementations can optimized the void variant.
> Proposal: {{void updateConditional}} and {{T findAndUpdateConditional}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to