Skip to content

introduce lazy removal from PriorityQueue for all routing algorithms - #2107

Closed
karussell wants to merge 5 commits into
masterfrom
priority_queue_faster2
Closed

karussell wants to merge 5 commits into
masterfrom
priority_queue_faster2

Conversation

@karussell

@karussell karussell commented Aug 4, 2020 •

Copy link
Copy Markdown
Member

Related to #489 and #2092.

Minor speed up. Picked point 2 from below performance investigations over the last weeks:

  1. the GHPriorityQueue that has an additional double[] array speeds up pure A* (max values are decreased), but speed is slower for LM and CH routing. Still the LM preparation is faster. See the branch priority_queue_faster. (CH preparation is slightly slower, nearly not significant, for bigger maps)

  2. when we remove the priorityQueue.remove call and allow stale SPTEntries we can have some speed ups although not so strong. But the advantage is that LM routing is also ~10% faster, the max values are reduced too and no changes for CH. This finding is interesting as when I tried this some years ago it reduced speed slightly.

  3. when implementing a faster priorityQueue.update method (that does remove and insert into the heap at the same time) I did not measure a difference for GHPriorityQueue (might be different for java's PriorityQueue).

  4. replacing our custom queue implementation in PreparationContractionHierarchies (GHTreeMapComposed) with a standard PriorityQueue then CH prep gets much slower. I'm sure I did something wrong but I couldn't find the problem. Another trial for PreparationContractionHierarchies could be to use the LongPriorityQueue from lucene, so that we can store key and value into the long[] array and avoid object creation.

  5. Combining 1 and 2 results in no changes for LM (i.e. an advantage over 1 alone) and significant speed up (35%!) for LM preparation (advantage over 1 and 2) but still slow CH routing (disadvantage over 2 alone).

  6. This does not speed up the algorithm: check if the traversalId is already existent in the opposite direction then we could avoid the approximation as we already know the exact complete path! We can even avoid calculating the weight for edge-based traversal.

update: something is wrong with my cherry-picked version of the original branch. Will have to investigate.

@karussell karussell added this to the 2.0 milestone Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant