v3.0.0-beta.1
Pre-release
Pre-release
Breaking Changes
- feat!: queries return structs instead of tuples. Query methods have been updated so that they all return
either aNearestNeighbour
,Vec<NearestNeighbour>
,
orVec<BestNeighbour>
, for consistency. - feat!: use a trait instead of a function pointer for distance metrics (See SquaredEuclidean and Manhattan)
- feat: add within_unsorted_iter query
Performance
- perf: refactor within to simply sort the result of within_unsorted.
Previously,within
was keeping its results in aBinaryHeap
and calling
itsinto_sorted_vec
method to, well, return a sortedVec
.
Whilst aBinaryHeap
is great if you are frequently adding and removing
items, if your use case is to gradually add all your items, and then sort
them all at once, its quicker to just put things in aVec
and then
sort theVec
at the end.
Benchmarking shows that this change improves performance by anything from
5 to 60% in practice.