nickva commented on code in PR #6032:
URL: https://github.com/apache/couchdb/pull/6032#discussion_r3414947919


##########
src/fabric/src/fabric_doc_update.erl:
##########
@@ -339,32 +339,38 @@ good_reply(_, _) ->
 
 -spec group_docs_by_shard(binary(), [#doc{}]) -> [{#shard{}, [#doc{}]}].
 group_docs_by_shard(DbName, Docs) ->
+    Grouped = group_docs([{Doc, mem3:shards(DbName, Id)} || #doc{id = Id} = 
Doc <- Docs]),

Review Comment:
   Updated with a `mem3:shards(Db, DocId, Shards)` helper to work on a snapshot 
of shards. So it will either go to the old version of the shardmap or the new 
one and should be bit faster since it's one shardmap ets table read, one hash 
function lookup then it's local operations. Before it was a lookup per docid



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to