ldr_tools uses special data structures for point comparisons and is multithreaded. It should give very good performance and reduce the amount of code to write if you're able to use Rust or Python.
https://github.com/ScanMountGoat/ldr_too...#ldr_tools
https://github.com/ScanMountGoat/ldr_too...#ldr_tools