Map Matching performance issue

Hello All!

I need some help on the performance of map matching. I’m using the map matching library inside a spring wrapper on a k8s cluster.

What we are seeing is that the application is performing a lot worse than the standard endpoint shipped with the server version of graphhopper, are we doing something wrong? We tried to copy down what is happening behind the scene on the server version.

Thank you for any response.

I’m adding some example code as a reference.

  public MatchResult mapMatch(
      @NotNull Collection<LocationPoint> points,
      @NotNull String profile,
      double measurementErrorSigma,
      double transitionProbabilityBeta) {

    PMap hints = new PMap();
    hints.putObject("profile", profile);
    // not sure the real effect because we should work in flexible mode
    // however doing the same as the original code in GraphHopper
    hints.putObject(Parameters.CH.DISABLE, true);

    var mapMatching = MapMatching.fromGraphHopper(mapMatchingFactory.graphHopperRuntime, hints);

    if (measurementErrorSigma != null) {
      mapMatching.setMeasurementErrorSigma(measurementErrorSigma);
    }

    if (transitionProbabilityBeta != null) {
      mapMatching.setTransitionProbabilityBeta(transitionProbabilityBeta);
    }

    return mapMatching.match(mapObservations(points));
  }

This looks alright to me. Did you try to compare your code with the code running in MapMatchingResource.java? The performance should be very similar indeed.

I basically tried to be as close as possible to the server version. I wanted only to check if there was something obvious missing.