First of all, thank you for your contribution to the hnswlib library.
I have deployed hnswlib on arm32 (linux 4.19.111 armv7l) using 'searchKnnCloserFirst_test.cpp' as an example.
I modified the original file parameters as follows:
int d = 128;
idx_t n = 5000;
idx_t nq = 10;
size_t k = 1;
I ran the demo on PC (Ubuntu 16.04) and arm32 respectively. I found that the code segment that took the longest time was
for (size_t i = 0; i < n; ++i) {
// alg_brute->addPoint(data.data() + d * i, i);
alg_hnsw->addPoint(data.data() + d * i, i); // 800ms on PC; 100+s on arm32
}
It takes about 800ms on PC and about 100s on arm32, a very big difference.
Before this, I had written a violent matching algorithm for arm32, using text reading to get 5000 data and traversing each data one by one, where loading data took about 2.3s and searching took about 500ms. In terms of time, hnswlib search is faster, about 5ms, however addPoint takes longer, also about 800ms on PC. I would like to ask for advice if there is a way to optimize this part of the time?
First of all, thank you for your contribution to the hnswlib library.
I have deployed hnswlib on arm32 (linux 4.19.111 armv7l) using 'searchKnnCloserFirst_test.cpp' as an example.
I modified the original file parameters as follows:
I ran the demo on PC (Ubuntu 16.04) and arm32 respectively. I found that the code segment that took the longest time was
It takes about 800ms on PC and about 100s on arm32, a very big difference.
Before this, I had written a violent matching algorithm for arm32, using text reading to get 5000 data and traversing each data one by one, where loading data took about 2.3s and searching took about 500ms. In terms of time, hnswlib search is faster, about 5ms, however
addPoint
takes longer, also about 800ms on PC. I would like to ask for advice if there is a way to optimize this part of the time?Thanks again for your work!