Skip to content
Merged
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
4 changes: 3 additions & 1 deletion python_tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,10 +725,12 @@ def test_find_in_index_range_issue_1(db0_fixture):
def test_insert_1M_keys_to_index(db0_no_autocommit):
cut = db0.index()
objects = [MemoTestClass(0) for _ in range(25000)]
# generate 1M random unique keys
keys_list = random.sample(range(0, 100_000_000), 1_000_000)
start = time.perf_counter()
for i in range(1_000_000):
# add random int
cut.add(random.randint(0, 100_000_000), objects[i % 25000])
cut.add(keys_list[i], random.choice(objects))
if i % 10_000 == 0:
assert len(cut) == i + 1
result = list(cut.select(0, 1))
Expand Down