Optionally cache CH/MLD edge distances #5197
Closed
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.
After a long and sordid path, we added
annotations=distances
to thetable
plugin back in #4990 and #5019These PRs implemented on-the-fly distance calculations - the table results are obtained, then the paths are unpacked to calculate the distances.
The upside to this is that it costs nothing in terms of resources (no extra preprocessing, no extra RAM) if you don't use this feature.
The downside is that it's a bit slow. With CH, large matrices that take 1-2 seconds to complete returning just durations can take upwards of 60 seconds to complete when distances are included.
@niemeier-PSI submitted #2764 way back which took the other approach - pre-calculate edge distances, and store them as an additional edge property. This approach is nice and fast, but has the downside that it requires quite a bit more RAM.
Fast-forward to 2018, @TheMarex dropped #4960 on us, which gives us a lot more flexibility with data formats. Suddenly, it's significantly easier to make some things optional, without awful hacks in our file reading code.
This PR is a re-implementation of #2764 but the overhead is optional, and doesn't require compile-time modifications to the OSRM codebase to switch.
Once this is complete, #2764 will be redundant.
** WORK IN PROGRESS - DO NOT MERGE **
Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?