4 ms·
Hey, author of the library here — feel free to ask me any questions! Very happy to see this trending on HN.
by mourner 8y ago
Hey, author of the library here — feel free to ask me any questions! Very happy to see this trending on HN.
- mattdesl 8y agoI often use your kdbush module for this, is there a case where flatbush is better for static points?
- mourner 8y agoI think kdbush should always be faster for points — it uses more than 2x less memory, because when you encode points as bounding boxes, you basically duplicate them. Indexing and search is faster mostly because you operate on less data.
- vanderZwan 8y agoBTW, the readme of kdbush and flatbush don't mention each other. Might be nice if they do and clarify how they compare. (because sometimes, people have an older, not updated library, for example)
- mourner 8y agoGood point, thank you! I'll interlink those.
- bufferoverflow 8y agoSo is it multithreaded? If so, how many cores does it scale to till it hits other bottlenecks? Does it load the cores to 100%?
- mourner 8y agoNo, it's single-threaded (it's pure JavaScript after all), but you can index data on a worker thread and then transfer the index instantly to the main thread for search queries. I don't think the algorithm needs parallelization — isn't worth the complexity, it's already fast enough.
- dandare 8y agoThis will immediately make my project faster, thank you kind stranger!