Skip to content

Commit

Permalink
rm speed test
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry committed Sep 23, 2023
1 parent 19e38b3 commit 07b0b16
Showing 1 changed file with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
import com.onthegomap.planetiler.geo.GeometryType;
import com.onthegomap.planetiler.mbtiles.Mbtiles;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.function.Function;
import java.util.function.IntFunction;
import java.util.function.UnaryOperator;
Expand Down Expand Up @@ -855,30 +853,4 @@ void removePointsOutsideBufferMultiPoints() throws GeometryException {
)
);
}

public static void main(String[] args) {
var random = new Random(0);
List<VectorTile.Feature> features = new ArrayList<>();
for (int i = 0; i < 10_000; i++) {
features.add(feature(1, newMultiPoint(
newPoint(random.nextDouble(-8, 256 + 8), random.nextDouble(-8, 256 + 8)),
newPoint(random.nextDouble(-8, 256 + 8), random.nextDouble(-8, 256 + 8)),
newPoint(random.nextDouble(-8, 256 + 8), random.nextDouble(-8, 256 + 8)),
newPoint(random.nextDouble(-8, 256 + 8), random.nextDouble(-8, 256 + 8)),
newPoint(random.nextDouble(-8, 256 + 8), random.nextDouble(-8, 256 + 8)),
newPoint(random.nextDouble(-8, 256 + 8), random.nextDouble(-8, 256 + 8)),
newPoint(random.nextDouble(-8, 256 + 8), random.nextDouble(-8, 256 + 8)),
newPoint(random.nextDouble(-8, 256 + 8), random.nextDouble(-8, 256 + 8)),
newPoint(random.nextDouble(-8, 256 + 8), random.nextDouble(-8, 256 + 8)),
newPoint(random.nextDouble(-8, 256 + 8), random.nextDouble(-8, 256 + 8))
), Map.of()));
}
for (int j = 0; j < 10; j++) {
long start = System.currentTimeMillis();
for (int i = 0; i < 10_000; i++) {
FeatureMerge.removePointsOutsideBuffer(features, 4);
}
System.err.println(System.currentTimeMillis() - start);
}
}
}

0 comments on commit 07b0b16

Please sign in to comment.