Repository navigation
Improve edge-based CH import performance - #2522
Merged
Merged
Conversation
# Conflicts: # tools/src/main/java/com/graphhopper/tools/Measurement.java
# Conflicts: # core/src/main/java/com/graphhopper/routing/ch/PrepareContractionHierarchies.java # core/src/test/java/com/graphhopper/routing/ch/CHTurnCostTest.java
# Conflicts: # core/src/main/java/com/graphhopper/routing/ch/EdgeBasedNodeContractor.java # core/src/main/java/com/graphhopper/routing/ch/EdgeBasedWitnessPathSearcher.java # core/src/test/java/com/graphhopper/routing/ch/EdgeBasedNodeContractorTest.java
This reverts commit 4a887ce.
Member
|
🚀
Wow :) |
4 of 13 tasks
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.
This PR improves the node contraction algorithm and parameters for edge-based CH and fixes #2375.
For the car/fastest profile with
u_turn_costs=80and using a recent OSM extract for Europe it reduced the CH preparation time by around 40% from 7.5h to 4.5h in my test. It slightly reduced the number of shortcuts as well (from 222mio to 209mio). The average query time for random queries in Bavaria was slightly slower (2.6ms vs 2.4ms). With this PR the preparation also takes slightly less memory, because I got rid of one integer array of size2*edges(for Europe this saves around2*95mio*4bytes = 760MB).However, the most important improvement here is that edge-based CH now works better for large u-turn costs and large edge weights as they occur when we enable e.g. the
GermanyCountryRule(this rule sets access=destination for tracks). For example in my test with master it took 221s to complete a car/fastest edge-based CH import for bayern-190101.osm.pbf withu_turn_costs=0, 720s foru_turn_costs=80and 1280s withu_turn_costs=200. With the improvements in this PR this is reduced to 181s (-19%), 440s (-39%) and 516s (-60%), so the import is faster especially for large u-turn costs.Including country rules the speed up is even better: For example for germany-190101.osm.pbf the car/fastest/u_turn_costs=40 import took 2733s without country rules in master and 10776s with country rules (almost four times slower). With this PR the import times stays around the same when enabling country rules! This means that including country rules this PR can yield a 10x speedup.
The most important changes leading to these improvements were:
Related: #1565