You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue is that it now scales out per record. Static searching is still as fast as it was, but the timings need to be updated to reflect changes to the DB handling.
#@pytest.mark.parametrize("num_records", [10, 100, 1000, 10000])
# def test_search_performance(db, num_records):
# # Get a connection from the database
# with db.get_connection() as conn:
# # Populate the database with test records
# for i in range(num_records):
# url = f'https://example.com/perf_test_{i}'
# info_dict = {'title': f'Performance Test Video {i}', 'uploader': 'Test Uploader'}
# # Pass the connection explicitly
# add_media_to_database(url, info_dict, [], 'Test summary', ['performance'],
# 'Test prompt', 'whisper-1', overwrite=True, db=db)
#
# # Perform the search
# start_time = time.time()
# # Pass the connection explicitly to the search function
# results = search_media_database('Performance Test', connection=conn)
# end_time = time.time()
#
# # Check results
# assert len(results) == num_records
#
# # Adjust performance expectations based on number of records
# if num_records <= 10:
# max_time = 0.1
# elif num_records <= 100:
# max_time = 0.5
# else:
# max_time = 2.0
#
# search_time = end_time - start_time
# print(f"Search time for {num_records} records: {search_time:.4f} seconds")
# assert search_time < max_time, f"Search took {search_time:.4f} seconds, which is more than the expected {max_time} seconds for {num_records} records"
#
# # Clean up the database after the test
# conn.execute("DELETE FROM Media")
# conn.execute("DELETE FROM MediaKeywords")
# conn.execute("DELETE FROM Keywords")
The text was updated successfully, but these errors were encountered:
Issue is that it now scales out per record. Static searching is still as fast as it was, but the timings need to be updated to reflect changes to the DB handling.
The text was updated successfully, but these errors were encountered: