Skip to content

Cache optimizing the PriorityQueue #489

Closed

Description

@karussell

We can try a b-heap to potentially improve routing query performance. See wikipedia. It is a bit memory waste but in case of CH requests could become interesting.

Another interesting data structure might be sorted hashmap with Robin Hood linear probing?

There are also so called "monotone queues" (see jheaps for Java implementations), but unfortunately those implementations are a lot slower than JDK's PriorityQueue.

Activity

  1. karussell commented on Nov 18, 2016

    @karussell
    MemberAuthor

    I'm currently playing a bit around with different implementations, e.g. no remove of the key (instead accepting some more undisturbing polls) and via a sorted map like TreeMap or ConcurrentSkipListMap and something like
    ((long) (entry.weight * 1000) << 32) | entry.adjNode
    for a Long key.

    The results are a bit disappointing (used Bavaria as test region): ConcurrentSkipListMap is roughly 50% slower, TreeMap is only 20% slower, no remove(key) call (accepting bigger prio queue) is also ~30% slower, CH routing is only 5-10% slower though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions