You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@baremaps.apache.org by bc...@apache.org on 2024/06/12 15:55:39 UTC
(incubator-baremaps) branch 849-benchmarking updated (f946c21c -> 021edd90)
This is an automated email from the ASF dual-hosted git repository.
bchapuis pushed a change to branch 849-benchmarking
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git
discard f946c21c Add benchmarks
new 021edd90 Add benchmarks
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (f946c21c)
\
N -- N -- N refs/heads/849-benchmarking (021edd90)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../baremaps/benchmarking/SmallFileBenchmark.java | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
(incubator-baremaps) 01/01: Add benchmarks
Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bchapuis pushed a commit to branch 849-benchmarking
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git
commit 021edd90832a2c309982addac6c7846d746fa65f
Author: Bertil Chapuis <bc...@gmail.com>
AuthorDate: Wed Jun 12 17:53:06 2024 +0200
Add benchmarks
---
.gitignore | 3 ++
.../baremaps/benchmarking/SmallFileBenchmark.java | 49 ++++++++++++++++++++++
2 files changed, 52 insertions(+)
diff --git a/.gitignore b/.gitignore
index a66d0430..15b5788b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,6 +49,9 @@ examples/openstreetmap/tiles/
examples/transformation/*.pbf
+# Benchmarking
+baremaps-benchmarking/small/
+
# Docs
.jekyll-cache/
_site/
diff --git a/baremaps-benchmarking/src/main/java/org/apache/baremaps/benchmarking/SmallFileBenchmark.java b/baremaps-benchmarking/src/main/java/org/apache/baremaps/benchmarking/SmallFileBenchmark.java
new file mode 100644
index 00000000..91a3ac46
--- /dev/null
+++ b/baremaps-benchmarking/src/main/java/org/apache/baremaps/benchmarking/SmallFileBenchmark.java
@@ -0,0 +1,49 @@
+package org.apache.baremaps.benchmarking;
+
+import org.apache.baremaps.geoparquet.GeoParquetReader;
+import org.openjdk.jmh.annotations.*;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.RunnerException;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.concurrent.TimeUnit;
+
+@BenchmarkMode(Mode.AverageTime)
+@OutputTimeUnit(TimeUnit.MILLISECONDS)
+@State(Scope.Benchmark)
+@Warmup(iterations = 0)
+@Measurement(iterations = 1)
+public class SmallFileBenchmark {
+
+ private Path source = Path.of("baremaps-testing/data/samples/example.parquet").toAbsolutePath();
+ private Path directory = Path.of("baremaps-benchmarking/small").toAbsolutePath();
+
+ public static void main(String[] args) throws RunnerException, IOException {
+ Options opt = new OptionsBuilder()
+ .include(SmallFileBenchmark.class.getSimpleName())
+ .forks(1)
+ .build();
+ new Runner(opt).run();
+ }
+
+ @Setup
+ public void setup() throws IOException {
+ if (!Files.exists(directory)) {
+ for (int i = 0; i < 1000; i++) {
+ Path target = directory.resolve(i + ".parquet");
+ Files.createDirectories(target.getParent());
+ Files.copy(source, target);
+ }
+ }
+ }
+
+ @Benchmark
+ public void read() {
+ GeoParquetReader reader = new GeoParquetReader(directory.toUri());
+ reader.readParallel().count();
+ }
+}