From 981c6e54b122604f46aa1da5b62104dff0fa3555 Mon Sep 17 00:00:00 2001 From: Marja van Aken Date: Wed, 7 Feb 2024 14:41:51 +0100 Subject: [PATCH] Removed printf statements from performance tests. --- .../java/io/parsingdata/metal/data/ByteStreamSourceTest.java | 4 ---- .../parsingdata/metal/data/ConcatenatedValueSourceTest.java | 3 --- .../java/io/parsingdata/metal/data/ConstantSourceTest.java | 4 ---- .../io/parsingdata/metal/data/DataExpressionSourceTest.java | 3 --- 4 files changed, 14 deletions(-) diff --git a/core/src/test/java/io/parsingdata/metal/data/ByteStreamSourceTest.java b/core/src/test/java/io/parsingdata/metal/data/ByteStreamSourceTest.java index 89feb2fd..ac9a53c8 100644 --- a/core/src/test/java/io/parsingdata/metal/data/ByteStreamSourceTest.java +++ b/core/src/test/java/io/parsingdata/metal/data/ByteStreamSourceTest.java @@ -45,7 +45,6 @@ public void brokenByteStream() { assertThrows(UncheckedIOException.class, () -> Slice.createFromSource(DUMMY_BYTE_STREAM_SOURCE, ZERO, TEN).get().getData()); } - @Test @Timeout(value=1) public void byteStreamSourceRead() { @@ -60,13 +59,10 @@ public void byteStreamSourceRead() { // Read from the source in small parts. final int readSize = 512; final byte[] valueBytes = new byte[arraySize]; - final long start = System.currentTimeMillis(); for (int part = 0; part < arraySize / readSize; part++) { final byte[] data = source.getData(valueOf(readSize * part), valueOf(readSize)); System.arraycopy(data, 0, valueBytes, readSize * part, data.length); } - final long end = System.currentTimeMillis(); - System.out.printf("Source read: %ss%n", (end - start) / 1000.0); // Make sure we read the data correctly. assertArrayEquals(bytes, valueBytes); diff --git a/core/src/test/java/io/parsingdata/metal/data/ConcatenatedValueSourceTest.java b/core/src/test/java/io/parsingdata/metal/data/ConcatenatedValueSourceTest.java index 95b70e13..f941c1e4 100644 --- a/core/src/test/java/io/parsingdata/metal/data/ConcatenatedValueSourceTest.java +++ b/core/src/test/java/io/parsingdata/metal/data/ConcatenatedValueSourceTest.java @@ -119,13 +119,10 @@ public void concatenatedValueSourceRead() { // Read from the source in small parts. final int readSize = 512; final byte[] bytesRead = new byte[arraySize]; - final long start = System.currentTimeMillis(); for (int part = 0; part < arraySize / readSize; part++) { final byte[] data = source.getData(valueOf(readSize * part), valueOf(readSize)); System.arraycopy(data, 0, bytesRead, readSize * part, data.length); } - final long end = System.currentTimeMillis(); - System.out.printf("Source read: %ss%n", (end - start) / 1000.0); // Make sure we read the data correctly. assertArrayEquals(bytes, bytesRead); diff --git a/core/src/test/java/io/parsingdata/metal/data/ConstantSourceTest.java b/core/src/test/java/io/parsingdata/metal/data/ConstantSourceTest.java index 90ce80f7..2c22d6a9 100644 --- a/core/src/test/java/io/parsingdata/metal/data/ConstantSourceTest.java +++ b/core/src/test/java/io/parsingdata/metal/data/ConstantSourceTest.java @@ -28,7 +28,6 @@ class ConstantSourceTest { - @Test @Timeout(value=1) public void constantSourceRead() { @@ -43,13 +42,10 @@ public void constantSourceRead() { // Read from the source in small parts. final int readSize = 512; final byte[] valueBytes = new byte[arraySize]; - final long start = System.currentTimeMillis(); for (int part = 0; part < arraySize / readSize; part++) { final byte[] data = source.getData(valueOf(readSize * part), valueOf(readSize)); System.arraycopy(data, 0, valueBytes, readSize * part, data.length); } - final long end = System.currentTimeMillis(); - System.out.printf("Source read: %ss%n", (end - start) / 1000.0); // Make sure we read the data correctly. assertArrayEquals(bytes, valueBytes); diff --git a/core/src/test/java/io/parsingdata/metal/data/DataExpressionSourceTest.java b/core/src/test/java/io/parsingdata/metal/data/DataExpressionSourceTest.java index 177bb2f1..ff269fe7 100644 --- a/core/src/test/java/io/parsingdata/metal/data/DataExpressionSourceTest.java +++ b/core/src/test/java/io/parsingdata/metal/data/DataExpressionSourceTest.java @@ -109,13 +109,10 @@ public void dataExpressionSourceRead() { // Read from the source in small parts. final int readSize = 512; final byte[] valueBytes = new byte[arraySize]; - final long start = System.currentTimeMillis(); for (int part = 0; part < arraySize / readSize; part++) { final byte[] data = source.getData(valueOf(readSize * part), valueOf(readSize)); System.arraycopy(data, 0, valueBytes, readSize * part, data.length); } - final long end = System.currentTimeMillis(); - System.out.printf("Source read: %ss%n", (end - start) / 1000.0); // Make sure we read the data correctly. assertArrayEquals(bytes, valueBytes);