You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/05/09 21:37:08 UTC

[couchdb] 01/02: Revert "Make couch_btree:chunkify/1 prefer fewer chunks"

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch COUCHDB-3298-optimize-writing-btree-nodes
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 56eafca869d6ba339fc38d64ff87d70c6e711355
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Tue May 9 10:55:34 2017 -0500

    Revert "Make couch_btree:chunkify/1 prefer fewer chunks"
    
    This reverts commit 8556adbb98e79a09ec254967ee6acf3bef8d1fb6.
---
 src/couch/src/couch_btree.erl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/couch/src/couch_btree.erl b/src/couch/src/couch_btree.erl
index adbc92b..d61daf1 100644
--- a/src/couch/src/couch_btree.erl
+++ b/src/couch/src/couch_btree.erl
@@ -342,9 +342,11 @@ complete_root(Bt, KPs) ->
 % it's probably really inefficient.
 
 chunkify(InList) ->
-    ChunkThreshold = get_chunk_size(),
+    BaseChunkSize = get_chunk_size(),
     case ?term_size(InList) of
-    Size when Size > ChunkThreshold ->
+    Size when Size > BaseChunkSize ->
+        NumberOfChunksLikely = ((Size div BaseChunkSize) + 1),
+        ChunkThreshold = Size div NumberOfChunksLikely,
         chunkify(InList, ChunkThreshold, [], 0, []);
     _Else ->
         [InList]

-- 
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.