Skip to content

Commit

Permalink
Add a test for capped queries
Browse files Browse the repository at this point in the history
  • Loading branch information
samhaswon committed May 16, 2024
1 parent 3d7f19c commit f574aae
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ def test_perf(self):
print(f"Total: {end - start:.4f}s\n"
f"{avg_time:.8f}s per search average ({avg_time * 10 ** 6:.4f}μs)")

def test_perf_max_results(self):
count = 200_000
self.bible_search.load('KJV')
start = time.perf_counter()
for i in range(count):
# Do some searching
self.bible_search.search("Jesus wept", max_results=100)
end = time.perf_counter()
avg_time = (end - start) / count
print(f"Total: {end - start:.4f}s\n"
f"{avg_time:.8f}s per search average ({avg_time * 10 ** 6:.4f}μs)")

def test_profile(self):
self.bible_search.load('KJV')
new_kjv_size = (getsize(self.bible_search) + self.bible_search.internal_index_size()) / (1024 ** 2)
Expand Down

0 comments on commit f574aae

Please sign in to comment.