Index: trunk/test/performance/org/openstreetmap/josm/io/OsmWriterPerformanceTest.java
===================================================================
--- trunk/test/performance/org/openstreetmap/josm/io/OsmWriterPerformanceTest.java	(revision 17848)
+++ trunk/test/performance/org/openstreetmap/josm/io/OsmWriterPerformanceTest.java	(revision 17848)
@@ -0,0 +1,60 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.io;
+
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.PerformanceTestUtils;
+import org.openstreetmap.josm.PerformanceTestUtils.PerformanceTestTimer;
+import org.openstreetmap.josm.data.osm.DataSet;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * This test tests how fast we are at writing an OSM file.
+ * <p>
+ * For this, we use the neubrandenburg-file, which is a good real world example of an OSM file.
+ */
+@Timeout(value = 15*60, unit = TimeUnit.SECONDS)
+class OsmWriterPerformanceTest {
+    private static final int TIMES = 4;
+    private DataSet neubrandenburgDataSet;
+
+    /**
+     * Prepare the test.
+     */
+    @BeforeAll
+    public static void createJOSMFixture() {
+        JOSMFixture.createPerformanceTestFixture().init(true);
+    }
+
+    /**
+     * Setup test
+     * @throws Exception if an error occurs
+     */
+    @BeforeEach
+    void setUp() throws Exception {
+        neubrandenburgDataSet = PerformanceTestUtils.getNeubrandenburgDataSet();
+    }
+
+    /**
+     * Tests writing OSM data
+     * @throws Exception if an error occurs
+     */
+    @Test
+    void testWriter() throws Exception {
+        PerformanceTestTimer timer = PerformanceTestUtils.startTimer("write .osm-file " + TIMES + " times");
+        for (int i = 0; i < TIMES; i++) {
+            try (StringWriter stringWriter = new StringWriter();
+                 OsmWriter osmWriter = OsmWriterFactory.createOsmWriter(new PrintWriter(stringWriter), true, OsmWriter.DEFAULT_API_VERSION)) {
+                osmWriter.write(neubrandenburgDataSet);
+            }
+        }
+        timer.done();
+    }
+
+}
