couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [couchdb] 01/02: Revert "Make couch_btree:chunkify/1 prefer fewer chunks"
Date Tue, 09 May 2017 21:37:08 GMT
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 <paul.joseph.davis@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" <commits@couchdb.apache.org>.

Mime
View raw message