Skip to content
This repository has been archived by the owner on Jan 17, 2020. It is now read-only.

consider cache stop_times to improve performance #195

Closed
carocad opened this issue Jul 8, 2018 · 2 comments
Closed

consider cache stop_times to improve performance #195

carocad opened this issue Jul 8, 2018 · 2 comments

Comments

@carocad
Copy link
Contributor

carocad commented Jul 8, 2018

Original issue taken from #174

Right now we rely solely on the trips available at the requested DateTime to find out the necessary stop.times every time that we try to find a trip.

https://github.com/hiposfer/kamal/blob/master/src/hiposfer/kamal/services/routing/directions.clj#L207

However, having the trips means that we can also know the stop.times and the stops available.

I think this would speed up the routing since we are doing all of these computations anyway but without this level of preprocessing.

I am not sure how much would this speed things up since we dont have a gtfs benchmark. So for the time being this is rather a nice to have.

@carocad
Copy link
Contributor Author

carocad commented Jul 8, 2018

Something that I can think of right now is basically to fetch all stop_times that are available and put them into a sorted-set like https://github.com/clojure/data.avl

Then sort those based on departure_time or on stop to have very fast query time.

NOTE: since clojure uses shared data structures, only the overhead of maintaining the indexes of the sets is added

@carocad carocad mentioned this issue Sep 1, 2018
@carocad
Copy link
Contributor Author

carocad commented Sep 8, 2018

closed in the reference above

@carocad carocad closed this as completed Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant