yahoojapan / NGT

Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data
Apache License 2.0
1.26k stars 115 forks source link

Specify num_threads for searching #133

Closed Charlyo closed 1 year ago

Charlyo commented 1 year ago

Dear developers!

Thank for all the work done in NGT.

Is there any way to also limit the number of threads for search?

masajiro commented 1 year ago

NGT uses just one thread for each one query. Does this answer your question?

Charlyo commented 1 year ago

By default, there's a ThreadPool created of 32 threads. It would be nice to be able to change this value in python.

masajiro commented 1 year ago

ThreadPool is used only for building an index. You can specified the size in these methods: batch_insert, build_index.