Skip to content

Commit

Permalink
change when prewarm run
Browse files Browse the repository at this point in the history
  • Loading branch information
cevian committed May 1, 2024
1 parent d994751 commit 2401aef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ann_benchmarks/algorithms/tsvector/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,6 @@ def fit(self, X: numpy.array) -> None:
chunks = self.list_chunks(conn)
if len(chunks) > 0:
self.index_chunks(chunks)
with self._pool.connection() as conn:
self.prewarm_heap(conn)
self.prewarm_index(conn)

def set_query_arguments(self, query_search_list_size, query_rescore):
self._query_search_list_size = query_search_list_size
Expand All @@ -367,6 +364,9 @@ def set_query_arguments(self, query_search_list_size, query_rescore):
self._pool.close()
self._pool = None
self.start_pool()
with self._pool.connection() as conn:
self.prewarm_heap(conn)
self.prewarm_index(conn)

def get_memory_usage(self) -> Optional[float]:
return psutil.Process().memory_info().rss / 1024
Expand Down

0 comments on commit 2401aef

Please sign in to comment.