Find Faster Alternative to KDTree Search

KD-Tree search is Monty's biggest speed bottleneck, so optimizing this would be beneficial.

As discussed in these videos on Monty's speed (part 1, part 2), KD-Tree search is the operation that Monty currently spends most time one.

Collin did a comparison of different methods in May 2025 and found that our current method was the best for our use case at the moment. For the full results, see this thread. However, there may be other nearest neighbor algorithms that were not tested there and that would do better in our scenario (finding nearest neighbors in 3D space).

Also see this thread on Discourse for more information of other speedups and KD-Tree alternatives we explored.




Help Us Make This Page Better

All our docs are open-source. If something is wrong or unclear, submit a PR to fix it!

Make a Contribution

Learn how to contribute to our docs