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
Remove distances from CH shortcuts #1719
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really clean. Nice!!
I can imagine that this makes preparation also a bit faster for German-sized installations or is the effect too small?
return ((CHEdgeIteratorState) edge).getWeight(); | ||
} else { | ||
return weighting.calcWeight(edge, false, EdgeIterator.NO_EDGE); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there two cases now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah this is just a helper method in this test, only for convenience. previously I used weighting.calcWeight
but since weighting is a shortest weighting here this is calling getDistance()
(which causes an exception for shortcuts). In production code this is a bit different because we normally would use PreparationWeighting
(but that does not have the instanceof check...).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Will try (its almost certainly not slower, but I am interested how such a change affects performance as well). |
This and this commit seem to have improved the (node-based) CH preparation time by about 10-15% (tried this for Germany only) |
Wow, that is a huge number for already highly tuned stuff. Nice. |
No longer store distances for CH shortcuts, they were not really used anyway.
This reduces memory consumption per shortcut by four bytes (now
9*4=36 bytes
for node-based and11*4=44 bytes
for edge-based CH). To retrieve the distance of a shortcut one can useShortcutUnpacker
and sum all the distances of the underlying real edges (this is the way we did it for path extraction already).Fixes #1690.