couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [01/36] couch commit: updated refs/heads/COUCHDB-3287-pluggable-storage-engines to 0fbcd0c [Forced Update!]
Date Thu, 06 Apr 2017 16:16:15 GMT
Repository: couchdb-couch
Updated Branches:
  refs/heads/COUCHDB-3287-pluggable-storage-engines 005ac9c20 -> 0fbcd0c73 (forced update)


Make couch_btree:chunkify/1 prefer fewer chunks

This changes couch_btree:chunkify/1 to produce fewer larger chunks
rather than creating chunks of even-ish size.

COUCHDB-3298


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/8556adbb
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/8556adbb
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/8556adbb

Branch: refs/heads/COUCHDB-3287-pluggable-storage-engines
Commit: 8556adbb98e79a09ec254967ee6acf3bef8d1fb6
Parents: bbbd532
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Sat Feb 11 15:26:26 2017 -0600
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Sat Feb 11 15:26:26 2017 -0600

----------------------------------------------------------------------
 src/couch_btree.erl | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/8556adbb/src/couch_btree.erl
----------------------------------------------------------------------
diff --git a/src/couch_btree.erl b/src/couch_btree.erl
index e9ff7f5..8f2395c 100644
--- a/src/couch_btree.erl
+++ b/src/couch_btree.erl
@@ -342,11 +342,9 @@ complete_root(Bt, KPs) ->
 % it's probably really inefficient.
 
 chunkify(InList) ->
-    BaseChunkSize = get_chunk_size(),
+    ChunkThreshold = get_chunk_size(),
     case ?term_size(InList) of
-    Size when Size > BaseChunkSize ->
-        NumberOfChunksLikely = ((Size div BaseChunkSize) + 1),
-        ChunkThreshold = Size div NumberOfChunksLikely,
+    Size when Size > ChunkThreshold ->
         chunkify(InList, ChunkThreshold, [], 0, []);
     _Else ->
         [InList]


Mime
View raw message