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

Implement hashing for many basic enums #164

Merged
merged 3 commits into from
May 14, 2024

Conversation

kylerchin
Copy link
Contributor

I don't have a use for implementing Hash for Trips or StopTimes yet, nor a good workaround for Option<f32> types.

I'm working on compression of schedules and I think at least the enums should implement hashing to allow direct comparison of time intervals. Most implementions of schedule parsers, such as Google Maps, likely do not store the entire dataset. I attempted to do that and it wound up being over 200 GB for the entire world. Implementations typically store the difference between each stop as an itinerary, and then trips are referenced via an offset to the itinerary. I can copy over the pickup and dropoff fields, and timepoint into my own struct and compute a hash of it, which becomes the Itinerary, then use it to match trip ids with a previous itinerary, along with an offset.

This paper describes it quite well: https://ad-publications.informatik.uni-freiburg.de/SIGSPATIAL_Frequency_based_Search_BBS_2014.pdf

Like my previous Clone pull request, this does increase compile time but is not a breaking change, nor does it worsen runtime.

Thank you so much once again,
Kyler Chin

Copy link
Collaborator

@antoine-de antoine-de left a comment

Choose a reason for hiding this comment

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

fine, for me, thanks for the contribution 👍

@kylerchin
Copy link
Contributor Author

When will this be merged?

@antoine-de antoine-de merged commit 6f04ed8 into rust-transit:main May 14, 2024
2 checks passed
@antoine-de
Copy link
Collaborator

oups, sorry, forgot to merge, done

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.

2 participants