From e395c9080396275b0631a55928f7eb96b011da02 Mon Sep 17 00:00:00 2001 From: Sheharyar Ahmad Date: Mon, 14 Oct 2024 20:28:18 +0500 Subject: [PATCH] Randomly pick start idx of test dataset in concurrency search. --- vectordb_bench/backend/runner/mp_runner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vectordb_bench/backend/runner/mp_runner.py b/vectordb_bench/backend/runner/mp_runner.py index 3b99cfe6e..6a9f7c979 100644 --- a/vectordb_bench/backend/runner/mp_runner.py +++ b/vectordb_bench/backend/runner/mp_runner.py @@ -2,6 +2,7 @@ import traceback import concurrent import multiprocessing as mp +import random import logging from typing import Iterable import numpy as np @@ -46,7 +47,7 @@ def search(self, test_data: list[list[float]], q: mp.Queue, cond: mp.Condition) cond.wait() with self.db.init(): - num, idx = len(test_data), 0 + num, idx = len(test_data), random.randint(0, len(test_data) - 1) start_time = time.perf_counter() count = 0