Optimize RAPTOR trip search by pre-calculating arrival/departure time arrays - #3919
Merged
hannesj merged 3 commits intoFeb 22, 2022
Merged
Conversation
t2gran
reviewed
Feb 21, 2022
| */ | ||
| int numberOfTripSchedules(); | ||
|
|
||
| public class Times { |
hannesj
force-pushed
the
otp2_optimize_trip_search
branch
3 times, most recently
from
February 21, 2022 16:14
37ace0b to
1ed48fa
Compare
hannesj
marked this pull request as ready for review
February 21, 2022 16:28
hannesj
force-pushed
the
otp2_optimize_trip_search
branch
from
February 21, 2022 23:44
1ed48fa to
ce7082d
Compare
hannesj
force-pushed
the
otp2_optimize_trip_search
branch
from
February 21, 2022 23:45
ce7082d to
c1e4151
Compare
Member
|
This looks really promising - thanks looking into it! |
hannesj
force-pushed
the
otp2_optimize_trip_search
branch
from
February 22, 2022 08:40
c6cc4ca to
4c16a22
Compare
leonardehrenfried
approved these changes
Feb 22, 2022
leonardehrenfried
left a comment
Member
There was a problem hiding this comment.
I used this PR on one of my densest data sets and it improved the performance by 5-10%.
t2gran
approved these changes
Feb 22, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Much of the time in the RAPTOR search is spent in fetching time tables for individual trips. This PR improves the performance by pre-calculating the times in an array, which can be scanned over.
Average speed test run times (n=10):
Upstream: 9.31s
2d arrays: 9.24s
1d arrays: 7.98s
Unit tests
None added
Code style
✅
Documentation
None needed
Changelog
The changelog file
is generated from the pull-request title, make sure the title describe the feature or issue fixed.
To exclude the PR from the changelog add
[changelog skip]in the title.