Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index roads instead of segments #22

Merged
merged 4 commits into from
May 18, 2018
Merged

Index roads instead of segments #22

merged 4 commits into from
May 18, 2018

Conversation

benjamintd
Copy link
Contributor

@benjamintd benjamintd commented May 17, 2018

Fixes #21

Instead of indexing and returning individual segments, we index the full road and return the index of the matching segment.

We avoid creating many segment objects in memory, and reduce the size of the index, at the cost of having larger bounding boxes in the index - thus potentially more candidates to check when matching a point.

The benchmark runs on average ~20% slower, although I suspect the effect would be less obvious on real datasets with larger indices.

Note that this creates a breaking change in the API, since we're not returning segments anymore.

@benjamintd benjamintd requested a review from tcql May 18, 2018 10:42
Copy link
Contributor

@tcql tcql left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! The performance hit is a bummer, but I see the improvement from a memory management perspective.

@benjamintd
Copy link
Contributor Author

Thanks @tcql for reviewing!

Using this branch in a production setting didn't show a noticeable performance drop, however memory usage was cut in half. I think it's good to merge.

@benjamintd benjamintd merged commit 95efea5 into master May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants