diff --git a/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java index fe7780ea0f..480bca455a 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java @@ -376,9 +376,9 @@ public class BinaryRoutePlanner { public static void printDebugMemoryInformation(RoutingContext ctx) { if (ctx.calculationProgress != null) { RouteCalculationProgress p = ctx.calculationProgress; - printInfo(String.format("Time. Total: %.2f, to load: %.2f, to load headers: %.2f, to calc dev: %.2f ", + printInfo(String.format("Time. Total: %.2f, to load: %.2f, to load headers: %.2f, to find start/end: %.2f, extra: %.2f ", p.timeToCalculate / 1e6, p.timeToLoad / 1e6, p.timeToLoadHeaders / 1e6, - p.timeNanoToCalcDeviation / 1e6)); + p.timeToFindInitialSegments / 1e6, p.timeNanoToCalcDeviation / 1e6)); // GeneralRouter.TIMER = 0; int maxLoadedTiles = Math.max(p.maxLoadedTiles, ctx.getCurrentlyLoadedTiles()); printInfo("Current loaded tiles : " + ctx.getCurrentlyLoadedTiles() + ", maximum loaded tiles " diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java b/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java index d6c6c6611f..03b49df3e5 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java @@ -122,6 +122,7 @@ public class RoutePlannerFrontEnd { public RouteSegmentPoint findRouteSegment(double lat, double lon, RoutingContext ctx, List list, boolean transportStop, boolean allowDuplications) throws IOException { + long now = System.nanoTime(); int px = MapUtils.get31TileNumberX(lon); int py = MapUtils.get31TileNumberY(lat); ArrayList dataObjects = new ArrayList(); @@ -172,6 +173,9 @@ public class RoutePlannerFrontEnd { return Double.compare(o1.distSquare, o2.distSquare); } }); + if (ctx.calculationProgress != null) { + ctx.calculationProgress.timeToFindInitialSegments += (System.nanoTime() - now); + } if (list.size() > 0) { RouteSegmentPoint ps = null; if (ctx.publicTransport) { @@ -275,7 +279,6 @@ public class RoutePlannerFrontEnd { start = next; } if(gctx.ctx.calculationProgress != null) { - // TODO gctx.ctx.calculationProgress.timeToCalculate = System.nanoTime() - timeToCalculate; } BinaryRoutePlanner.printDebugMemoryInformation(gctx.ctx); @@ -664,8 +667,7 @@ public class RoutePlannerFrontEnd { res = searchRouteImpl(ctx, points, routeDirection); } if (ctx.calculationProgress != null) { - // TODO - ctx.calculationProgress.timeToCalculate = System.nanoTime() - timeToCalculate; + ctx.calculationProgress.timeToCalculate = System.nanoTime() - timeToCalculate; } BinaryRoutePlanner.printDebugMemoryInformation(ctx); if (res != null) { diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RoutingContext.java b/OsmAnd-java/src/main/java/net/osmand/router/RoutingContext.java index 99d959265d..81f4936234 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RoutingContext.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RoutingContext.java @@ -420,7 +420,6 @@ public class RoutingContext { } TLongHashSet ts = new TLongHashSet(); - long now = System.nanoTime(); for(int i = -t; i <= t; i++) { for(int j = -t; j <= t; j++) { ts.add(getRoutingTile(x31 +i*coordinatesShift, y31 + j*coordinatesShift, 0)); @@ -434,9 +433,6 @@ public class RoutingContext { excludeDuplications.clear(); } } - if (calculationProgress != null) { - calculationProgress.timeToFindInitialSegments += (System.nanoTime() - now); - } } @SuppressWarnings("unused")