Skip to content

Commit

Permalink
Use more sensible defaults for tree
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasLM committed Jan 8, 2018
1 parent 1c735ba commit 2786a8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bplustree/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class BPlusTree:

# ######################### Public API ################################

def __init__(self, filename: str, page_size: int= 4096, order: int=4,
key_size: int=16, value_size: int=16, cache_size: int=512,
def __init__(self, filename: str, page_size: int= 4096, order: int=100,
key_size: int=8, value_size: int=32, cache_size: int=64,
serializer: Optional[Serializer]=None):
self._filename = filename
self._tree_conf = TreeConf(
Expand Down
8 changes: 4 additions & 4 deletions tests/test_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@pytest.fixture
def b():
b = BPlusTree(filename)
b = BPlusTree(filename, key_size=16, value_size=16, order=4)
yield b
b.close()

Expand All @@ -43,8 +43,8 @@ def test_closing_context_manager(mock_close):
def test_initial_values():
b = BPlusTree(filename, page_size=512, value_size=128)
assert b._tree_conf.page_size == 512
assert b._tree_conf.order == 4
assert b._tree_conf.key_size == 16
assert b._tree_conf.order == 100
assert b._tree_conf.key_size == 8
assert b._tree_conf.value_size == 128
b.close()

Expand Down Expand Up @@ -106,7 +106,7 @@ def test_len_tree(b):


def test_length_hint_tree():
b = BPlusTree(filename, order=100)
b = BPlusTree(filename, key_size=16, value_size=16, order=100)
assert b.__length_hint__() == 49
b.insert(1, b'foo')
assert b.__length_hint__() == 49
Expand Down

0 comments on commit 2786a8c

Please sign in to comment.