public MiniPerfTest start() { int warmupCount = Math.max(1, counts / 3); for (int i = 0; i < warmupCount; i++) { dummySum += doCalc(true, i); } long startFull = System.nanoTime(); for (int i = 0; i < counts; i++) { long start = System.nanoTime(); dummySum += doCalc(false, i); long time = System.nanoTime() - start; if (time < min) min = time; if (time > max) max = time; } fullTime = System.nanoTime() - startFull; logger.info("dummySum:" + dummySum); return this; }
/** * @return mean time per call, in ms */ public double getMean() { return getSum() / counts; }
private void printLocationIndexQuery(Graph g, final LocationIndex idx, int count) { count *= 2; final BBox bbox = g.getBounds(); final double latDelta = bbox.maxLat - bbox.minLat; final double lonDelta = bbox.maxLon - bbox.minLon; final Random rand = new Random(seed); MiniPerfTest miniPerf = new MiniPerfTest() { @Override public int doCalc(boolean warmup, int run) { double lat = rand.nextDouble() * latDelta + bbox.minLat; double lon = rand.nextDouble() * lonDelta + bbox.minLon; int val = idx.findClosest(lat, lon, EdgeFilter.ALL_EDGES).getClosestNode(); // if (!warmup && val >= 0) // list.add(val); return val; } }.setIterations(count).start(); print("location_index", miniPerf); }
/** * @return mean time per call, in ms */ public double getMean() { return getSum() / counts; }
}.setIterations(count).start();
private void print(String prefix, MiniPerfTest perf) { logger.info(prefix + ": " + perf.getReport()); properties.put(prefix + ".sum", "" + (Object) perf.getSum()); properties.put(prefix + ".min", "" + (Object) perf.getMin()); properties.put(prefix + ".mean", "" + (Object) perf.getMean()); properties.put(prefix + ".max", "" + (Object) perf.getMax()); }
/** * @return mean time per call, in ms */ public double getMean() { return getSum() / counts; }
public MiniPerfTest start() { int warmupCount = Math.max(1, counts / 3); for (int i = 0; i < warmupCount; i++) { dummySum += doCalc(true, i); } long startFull = System.nanoTime(); for (int i = 0; i < counts; i++) { long start = System.nanoTime(); dummySum += doCalc(false, i); long time = System.nanoTime() - start; if (time < min) min = time; if (time > max) max = time; } fullTime = System.nanoTime() - startFull; logger.info("dummySum:" + dummySum); return this; }
return GHUtility.count(chExplorer.setBaseNode(nodeId)); }.setIterations(count).start(); print("unit_testsCH.level_edge_state_next", miniPerf); }.setIterations(count).start(); print("unit_testsCH.get_weight", miniPerf); return GHUtility.count(outExplorer.setBaseNode(nodeId)); }.setIterations(count).start(); print("unit_tests" + description + ".out_edge_state_next", miniPerf); return GHUtility.count(allExplorer.setBaseNode(nodeId)); }.setIterations(count).start(); print("unit_tests" + description + ".all_edge_state_next", miniPerf); }.setIterations(count).start(); print("unit_tests" + description + ".get_edge_state", miniPerf);
/** * @return mean time per call, in ms */ public double getMean() { return getSum() / counts; }
public MiniPerfTest start() { int warmupCount = Math.max(1, counts / 3); for (int i = 0; i < warmupCount; i++) { dummySum += doCalc(true, i); } long startFull = System.nanoTime(); for (int i = 0; i < counts; i++) { long start = System.nanoTime(); dummySum += doCalc(false, i); long time = System.nanoTime() - start; if (time < min) min = time; if (time > max) max = time; } fullTime = System.nanoTime() - startFull; logger.info("dummySum:" + dummySum); return this; }
/** * Test the performance of finding candidate points for the index (which is run for every GPX * entry). * */ private void printLocationIndexMatchQuery(final LocationIndexTree idx) { final double latDelta = bbox.maxLat - bbox.minLat; final double lonDelta = bbox.maxLon - bbox.minLon; final Random rand = new Random(seed); MiniPerfTest miniPerf = new MiniPerfTest() { @Override public int doCalc(boolean warmup, int run) { double lat = rand.nextDouble() * latDelta + bbox.minLat; double lon = rand.nextDouble() * lonDelta + bbox.minLon; return idx.findNClosest(lat, lon, EdgeFilter.ALL_EDGES, rand.nextDouble() * 500).size(); } }.setIterations(count).start(); print("location_index_match", miniPerf); }
public MiniPerfTest start() { int warmupCount = Math.max(1, counts / 3); for (int i = 0; i < warmupCount; i++) { dummySum += doCalc(true, i); } long startFull = System.nanoTime(); for (int i = 0; i < counts; i++) { long start = System.nanoTime(); dummySum += doCalc(false, i); long time = System.nanoTime() - start; if (time < min) min = time; if (time > max) max = time; } fullTime = System.nanoTime() - startFull; logger.info("dummySum:" + dummySum); return this; }
}.setIterations(count).start(); print("map_match", miniPerf);