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

Revert allow multiple states during transfer edge traversals #6357

Conversation

vpaturet
Copy link
Contributor

@vpaturet vpaturet commented Jan 3, 2025

Summary

This PR reverts #6238 which seems to cause performance issues in our production environment.

Issue

No

Unit tests

No

Documentation

No

@vpaturet vpaturet self-assigned this Jan 3, 2025
@vpaturet vpaturet added Bug Entur Test This is currently being tested at Entur labels Jan 3, 2025
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 72.41379% with 8 lines in your changes missing coverage. Please review.

Project coverage is 69.84%. Comparing base (e1b3064) to head (868a8db).
Report is 207 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...tripplanner/street/search/state/EdgeTraverser.java 40.00% 4 Missing and 2 partials ⚠️
...algorithm/mapping/RaptorPathToItineraryMapper.java 85.71% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6357      +/-   ##
=============================================
- Coverage      69.85%   69.84%   -0.02%     
+ Complexity     17927    17919       -8     
=============================================
  Files           2035     2035              
  Lines          76509    76506       -3     
  Branches        7825     7823       -2     
=============================================
- Hits           53446    53434      -12     
- Misses         20324    20330       +6     
- Partials        2739     2742       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@miklcct
Copy link
Contributor

miklcct commented Jan 3, 2025

I will also try this out in our test environment. It currently takes about 2 minutes for walk and 5 minutes for bike for a response with a new configuration on our test environment with about 6M walk and 15M bike transfers.

In particular, I will check if both walk and bike route planning still works correctly.

@miklcct
Copy link
Contributor

miklcct commented Jan 4, 2025

I have deployed this change in Aubin (GB wide data) test server. The response time of a new preference has been improved to about half a minute for walk, and 75 seconds for bike, whereas before it was about 2 minutes for walk and 5 minutes for bike.

@leonardehrenfried
Copy link
Member

I can confirm that this PR makes start up and transfer cache computation a lot faster.

In order to have some hard numbers I also added some data to the speed test: #6362

Comment on lines +370 to +376
var states = e.traverse(s);
if (State.isEmpty(states)) {
s = null;
} else {
transferStates.add(states[0]);
s = states[0];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We can revert this for the performance benefit. It may be useful to add a check here to avoid problems related to A* searches returning multiple states similar to EdgeTraverser.

@vpaturet
Copy link
Contributor Author

vpaturet commented Jan 7, 2025

For reference, flame graph showing the impact of #6238 on RaptorRequestTransferCache

Screenshot from 2025-01-07 11-02-57

@vpaturet vpaturet marked this pull request as ready for review January 9, 2025 14:08
@vpaturet vpaturet requested a review from a team as a code owner January 9, 2025 14:08
@leonardehrenfried
Copy link
Member

I'm fine with this, but I believe we want to merge #6362 first so we can see the difference.

@t2gran t2gran added Entur Test This is currently being tested at Entur and removed Entur Test This is currently being tested at Entur labels Jan 15, 2025
Copy link
Member

@leonardehrenfried leonardehrenfried left a comment

Choose a reason for hiding this comment

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

image

We now have the speed test so this can go ahead.

@vpaturet vpaturet merged commit 448ad8f into opentripplanner:dev-2.x Jan 20, 2025
5 checks passed
@vpaturet vpaturet deleted the revert_allow_multiple_states_during_transfer_edge_traversals branch January 20, 2025 10:42
t2gran pushed a commit that referenced this pull request Jan 20, 2025
@leonardehrenfried
Copy link
Member

You can see the drastic speed up here: https://tinyurl.com/22gb52tr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Entur Test This is currently being tested at Entur
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants