Repository navigation
Description
It goes like this:
-
During pass1 of the OSM import we call
EncodingManager#acceptWayfor every OSM way (except those with only one node or no tags).acceptWaycallsgetAccessfor eachFlagEncoderwhich returns eitherWAY,FERRYorCAN_SKIPfor each way. The valueOTHERis never used (at least not here). However, it then only checks whether or not any of the encoders returned something other thanCAN_SKIP. So basically there is nothing to optimize here: We need to callgetAccessonce per way for each encoder. The distinction betweenFERRYandWAYis not used. -
pass2 is more interesting: We do the same as in pass1 (filter out all ways for which
EncodingManager#acceptWayis false, but besides filtering the ways we also need to calculate the edge flags for each way. This is done inEncodingManager#handleWayTags, which takes anAcceptWay(the result ofEncodingManager#acceptWayas input parameter. This allows a potential optimization: We can reuse the result of the firstacceptWaycall here.
However, we do not even do this optimization anymore since #2448. I therefore tried putting it back here: fa7c84b and it turns out there is no measurable speedup, and even more so there is no significant speedup that really justifies this added complexity it seems. I also tried doing this with more (5) flag encoders. Even when I repeated the acceptWay check eleven times the slowdown was still only around 50%. I think we should remove this.
The first step would probably be adding public IntsRef handleWayTags(ReaderWay way, IntsRef relationFlags) to EncodingManager (without the acceptWay parameter) and calling acceptWay inside. But then we should also remove the ferry parameter from TagParser#handleWayTags and remove the acceptWay parameter from AbstractFlagEncoder#handleWayTags.
Activity
easbar commentedon Nov 18, 2021
We should fix #2465 before this.