Minor performance improvements#3767
Merged
Merged
Conversation
getBannedRoutes is currently responsible of the majority of time in setRoutingContext
This reduces street routing time by approximately 5%
| ALL(4 | 2 | 1); | ||
|
|
||
| private static final Map<Integer, StreetTraversalPermission> lookup = new HashMap<Integer, StreetTraversalPermission>(); | ||
| private static final StreetTraversalPermission[] lookup = new StreetTraversalPermission[8]; |
Member
There was a problem hiding this comment.
Can you replace the 8 with a call to EnumSet.allOf(StreetTraversalPermission.class).size() in the static initializer?
Member
|
This looks good. Since I've contributed a couple of tests that check the street routing in a lot of detail I'm satisfied that this change doesn't change the logic. |
ef05fa1 to
05d2819
Compare
leonardehrenfried
approved these changes
Dec 7, 2021
t2gran
approved these changes
Dec 7, 2021
optionsome
approved these changes
Dec 7, 2021
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
When profiling the walkable area builder, I also took a look at the routing performance, and found these two low hanging fruits for performance increases.
There are two potential additional easy wins, which should be looked at
RaptorRoutingRequestTransitData#routeIterator