Closed ttsugriy closed 1 year ago
Hi @ttsugriy , thank you for the pull request! It looks like it causes some errors in the CI. Can you please look at it? I also wonder if you tested that it does not affect the performance?
Hello, Yury! Unfortunately it looks like there are many callsites that use explicit pointer type instead of auto
, so many more changes are required to migrate to unique_ptr. As for performance, this change doesn't affect it, since member initialization change involves only primitive types and unique_ptr is identical to raw pointer in the assembly.
Got it, thanks!
Thank you, @yurymalkov! I'm a huge fan of HNSW, so thank you very much for inventing it!
@ttsugriy Thank you for the kind words! A lot of the hnswlib's value came from external PR contributions! :)
It's error-prone to use raw pointers instead of
std::unique_ptr
which has no extra overhead compared to raw pointer but is easier to use. Also, it's better to use member initializer instead of constructor body.