Graphhopper 5 performance


I moved from graphhopper 0.13 to 5.0 and I noticed a lower performance in routing algorithms. After analyzing it I observed that 5.0 queries with lat lon from to positions matching with tower nodes are slower than queries where lat lon locations produce virtual nodes/edges in the query graph. In 0.13 both type of queries run with same performance.

The request in 5.0 is created as follows:

        GHRequest request = new GHRequest(52.573714149556764, -0.24778699225455053, 53.48844184173238, -2.2459881841582647)

        request.putHint("elevation", "false");
        request.putHint(Parameters.Landmark.DISABLE, false);
        request.putHint(Parameters.CH.DISABLE, true);
        request.putHint(Parameters.Algorithms.AltRoute.MAX_PATHS, 15);
        request.putHint("alternative_route.min_plateau_factor", 0.01);
        request.putHint("alternative_route.max_weight_factor", 2.5);
        request.putHint("alternative_route.max_share_factor", 0.95);
        request.putHint(Parameters.Routing.INSTRUCTIONS, false);
        request.putHint(Parameters.Routing.CALC_POINTS, false);

I executed same query with different positions:

  • QueryGraph with virtual nodes 52.573714149556764, -0.24778699225455053, 53.48844184173238, -2.2459881841582647
  • QueryGraph with no virtual nodes 52.5736626,-0.247718, 53.4884214,-2.2458235

In 0.13 each request executed 10 times took 20s while in 5.0 the first one took 20s and the second one took 35s.

For a few queries it is not a problem, but running thousands of queries time increases in terms of minutes or hours.

Is it the expected behavior?

As you use alternative routes the returned routes are very likely also different between versions, especially as you use a very high number of alternative routes.

Did you have a look into the actual alternatives if they changed between versions?
And do you see a slow down if you do not change the algorithm to ALT_ROUTE?

Alternatives are almost the same, only one is different, see images below (alternatives for gh 5.0 and for gh 0.13):

When removing ALT_ROUTE, thus getting just one route, it is consistent, there is no slow down and gh 5.0 is a bit faster than 0.13

Powered by Discourse