georust / rstar

R*-tree spatial index for the Rust ecosystem
https://docs.rs/rstar
Apache License 2.0
384 stars 67 forks source link

Discussion: Flat representation of R-tree #132

Closed adamreichold closed 7 months ago

adamreichold commented 11 months ago

(Sorry for abusing the issue tracker for what is actually a discussion/request for comments.)

I am working on a flat representation of an R-tree over at https://github.com/adamreichold/sif-rtree. This enables using memory maps as the backing store without going through the complications of the as yet unstable allocator API. It does have the significant downside of practically forcing the data structure to be immutable as far as I can see though.

The performance of spatial queries seems to be equal to or within a few percent of the rstar crate itself. (It can be brought to exactly the same level by using unchecked indexing but that would force unsafe code usage and validation issues with deserialized data structures.) The construction builds exactly the same trees as our RTree::bulk_load function here.

The two observations I made while working on that which I would like to discuss here are:

adamreichold commented 7 months ago

Let's focus on keeping the existing code base alive.