mapbox / which-polygon

Index for matching points against a set of GeoJSON polygons
ISC License
133 stars 14 forks source link

Switch to Flatbush #10

Open mourner opened 5 years ago

mourner commented 5 years ago

Since the use case is static, switching from RBush to Flatbush would make which-polygon faster and use less memory.

lidaof commented 5 years ago

Hi @mourner , just curious, is this switching done or still ongoing? Thank you!

mourner commented 5 years ago

Haven't attempted it yet.

lidaof commented 5 years ago

Thank you for updating @mourner

underbluewaters commented 4 years ago

I swapped out RBush with Flatbush and not seeing much of a performance difference at all. Utilizing Flatbush means one can save the index data for later use though, so that is nice.

Performance before:

before

And after:

after

Not really thinking this was worth the effort but I did it so I guess I might as well make it available 😂