hnswlib
hnswlib copied to clipboard
Optimize rebuildIndex memory allocation
- The current data_level0_memory_ continuous memory block design can result in memory doubling during large index resize, which is very unfriendly to memory and performance(the realloc operation may trigger an expensive data copy action),so we redesigned data_level0_memory_ (using multiple small memory blocks linked together).
- In addition, we found some obvious _mm_prefetch out-of-bounds access issues and fixed them (there may be other hidden issues, please check them as well).
#510