Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,15 @@ public class MVStoreModuleBuilder {

/**
* The amount of memory a MVStore page should contain at most, in bytes,
* before it is split. The default is 16 KB.
*/
private int pageSplitSize = 16;
* before it is split. The default is 16 KB, which is also MVStore's own
* default for a persistent store.
* <p>
* MVStore reads this value in bytes. It used to default to {@code 16}, so
* every leaf page split as soon as it held more than one entry: a store
* carried roughly one entry per page, and every lookup descended a tree
* about twice as deep as it needed to be.
*/
private int pageSplitSize = 16 * 1024;

/**
* The file store used by the MVStore.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void testConstructor() {
assertTrue(actualMvStoreModuleBuilder.autoCommit());
assertFalse(actualMvStoreModuleBuilder.recoveryMode());
assertFalse(actualMvStoreModuleBuilder.readOnly());
assertEquals(Short.SIZE, actualMvStoreModuleBuilder.pageSplitSize());
assertEquals(16 * 1024, actualMvStoreModuleBuilder.pageSplitSize());
assertNull(actualMvStoreModuleBuilder.fileStore());
assertEquals("Path", actualMvStoreModuleBuilder.filePath());
assertTrue(actualMvStoreModuleBuilder.eventListeners().isEmpty());
Expand Down Expand Up @@ -66,7 +66,7 @@ public void testConstructor2() {
MVStoreModuleBuilder actualMvStoreModuleBuilder = new MVStoreModuleBuilder();
assertTrue(actualMvStoreModuleBuilder.autoCommit());
assertFalse(actualMvStoreModuleBuilder.recoveryMode());
assertEquals(Short.SIZE, actualMvStoreModuleBuilder.pageSplitSize());
assertEquals(16 * 1024, actualMvStoreModuleBuilder.pageSplitSize());
assertTrue(actualMvStoreModuleBuilder.eventListeners().isEmpty());
assertEquals(1024, actualMvStoreModuleBuilder.autoCommitBufferSize());
assertEquals(Short.SIZE, actualMvStoreModuleBuilder.cacheSize());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void testWithConfig() {
MVStoreModuleBuilder actualWithConfigResult = MVStoreModule.withConfig();
assertTrue(actualWithConfigResult.autoCommit());
assertFalse(actualWithConfigResult.recoveryMode());
assertEquals(Short.SIZE, actualWithConfigResult.pageSplitSize());
assertEquals(16 * 1024, actualWithConfigResult.pageSplitSize());
assertTrue(actualWithConfigResult.eventListeners().isEmpty());
assertEquals(1024, actualWithConfigResult.autoCommitBufferSize());
assertEquals(Short.SIZE, actualWithConfigResult.cacheSize());
Expand Down
Loading