Skip to content

Commit c577f43

Browse files
algoriddlefacebook-github-bot
authored andcommitted
fix perf test (facebookresearch#3255)
Summary: Pull Request resolved: facebookresearch#3255 Reviewed By: mlomeli1 Differential Revision: D53811550 fbshipit-source-id: b103dc2d0cf43cabb9e4e7e74f4e737ff39fbbbc
1 parent 8400ece commit c577f43

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

tests/test_fastscan_perf.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
TEST(TestFastScan, knnVSrange) {
2323
// small vectors and database
2424
int d = 64;
25-
size_t nb = 1000;
25+
size_t nb = 4000;
2626

2727
// ivf centroids
2828
size_t nlist = 4;
@@ -52,16 +52,12 @@ TEST(TestFastScan, knnVSrange) {
5252
std::vector<faiss::idx_t> labels(nb);
5353
auto t = std::chrono::high_resolution_clock::now();
5454
index.search(nb, database.data(), 1, distances.data(), labels.data());
55-
auto knn_time = std::chrono::duration_cast<std::chrono::milliseconds>(
56-
std::chrono::high_resolution_clock::now() - t)
57-
.count();
55+
auto knn_time = std::chrono::high_resolution_clock::now() - t;
5856

5957
faiss::RangeSearchResult rsr(nb);
6058
t = std::chrono::high_resolution_clock::now();
6159
index.range_search(nb, database.data(), 1.0, &rsr);
62-
auto range_time = std::chrono::duration_cast<std::chrono::milliseconds>(
63-
std::chrono::high_resolution_clock::now() - t)
64-
.count();
60+
auto range_time = std::chrono::high_resolution_clock::now() - t;
6561

6662
// we expect the perf of knn and range search
6763
// to be similar, at least within a factor of 4

0 commit comments

Comments
 (0)